what is the procedure to add Microsoft Identity Platform (Azure AD) authentication to an existing (empty) Blazor project? - azure-active-directory

I have looked around for a while and am unable to find any comprehensive reference to list of steps required to integrate Microsoft Identity Platform (Azure AD) authentication into an existing Blazor (or .Net Core Web) app. I have an existing Blazor project which was setup with NO authentication option selected at create time. i am looking to do the following:
authenticate against Azure AD
scaffold/override /MicrosoftIdentity/Account/ actions
appreciate any input that can point me in the right direction.

Related

Migrate Applications with ADFS Activity Report

We are using the ADFS activity report to migrate our applications to AAD. Everything shows as Ready and when we click on the Ready link, the text says "We've detected on-premises settings for this relying party that can be migrated to a new Azure AD enterprise application. We'll map the fields and create the new application, but users won't be redirected to it until you say so." By the last statement, it seems like the application is automatically created now. Is that the case? If so, how long does it take to create the application and does it keep the same name as in ADFS?
• The message that you encountered “We've detected on-premises settings for this relying party that can be migrated to a new Azure AD enterprise application. We'll map the fields and create the new application, but users won't be redirected to it until you say so.” Means that the application is a SaaS application available in Enterprise application gallery in Azure AD. This does not in anyway mean that the application has been created automatically, it just means that the application is ready to be migrated to Azure AD and is fully available as a SaaS application in Azure AD gallery and doesn’t need any further relying party configuration migration from the on-premises ADFS server.
• Since the message is displayed only for SaaS apps readily available in Azure AD gallery and are equally configured as a relying party trust in ADFS, its configuration information is readily migrated through the ADFS Connect health application to Azure AD and it can be configured in the cloud itself with admin account access needed for the SaaS application’s account for SSO and SAML authentication configuration required through Azure AD.
You can find the image below for your reference, it shows the ‘Dropbox’ application as ready for migration from ADFS to Azure AD: -
Through the above option enabled, you can easily configure your application’s SSO configuration in Azure AD. If all the configurations are up and running, it will happen instantaneously within a few minutes of time.
Kindly refer to this link for more information on migrating federated apps from ADFS to Azure AD: -
https://github.com/AzureAD/Deployment-Plans/tree/master/ADFS%20to%20AzureAD%20App%20Migration
I think the report is still in preview and it is missing a create application button.
All the documentation only shows the reports & not the create process.
Also this migration tool, is a repackage of the powershell test commands:
https://github.com/AzureAD/Deployment-Plans/tree/master/ADFS%20to%20AzureAD%20App%20Migration
So I assume you need to create the application manually based on the report.

Configure SAML Single Sign-on in Azure with ITfoxtec SAML 2.0

I'm trying to implement SAML authentication in .Net Core 3.1. I'm using the sample project TestWebAppCore from this official repo.
I have the values below and I need to adapt the sample project considering Azure AD as an Identity Provider:
Login URL
Azure AD Identifier
Logout URL
I also have a .xml and a .cer file.
My questions are:
Login URL is the configuration SingleSignOnDestination?
Logout URL is the configuration SingleLogoutDestination?
Azure AD Identifier is the configuration IdPMetadata?
Can I remove the code that refers to SigningCertificatePassword (.pfx file) and add reference to my .cer file?
Do I need to use the xml file? Where?
If you integrate with an Azure AD Enterprise Application I think you should use the Enterprise Applications metadata to configure (config parameter IdPMetadata) ITfoxtec Identity SAML 2.0 in the .NET application.
SingleSignOnDestination is the Azure AD Enterprise Application login endpoint.
SingleLogoutDestination as I remember an Azure AD Enterprise Application do not support SAML 2.0 logout.
AllowedIssuer is the Azure AD Enterprise Application issuer.
SigningCertificate need to contain a certificate with both public and private key like a .pfx. A .cer only contain the public key.

Sharepoint Online OAuth 2.0 invalid token type for new O365 tenant

I have been using Sharepoint Online REST API to integrate with my O365 AddIn app which is working perfectly fine for my Old O365 tenant.
However I am getting an error while I am trying to call any API with the Bearer token that I get for my new O365 tenant app.
{"error":"invalid_request","error_description":"Token type is not allowed."}
Is the auth token URL changed for new tenants, or is it something else.
I am using https://accounts.accesscontrol.windows.net/{{tenant_id}}/tokens/OAuth/2
Azure Access Control (ACS), a service of Azure Active Directory (Azure AD), got retired on November 7, 2018. This retirement doesn't impact the SharePoint Add-in model, which uses the https://accounts.accesscontrol.windows.net hostname (which isn't impacted by this retirement).
Check out Impact of Azure Access Control retirement for SharePoint add-ins.
Note that, you can connect SharePoint directly to Azure AD using token issuance policies.
SharePoint 2013, 2016, and SharePoint Online customers have long used ACS for authentication purposes in the cloud, on-prem, and hybrid scenarios. Some SharePoint features and use cases will be affected by ACS retirement, while others will not. The below table summarizes migration guidance for some of the most popular SharePoint feature that leverage ACS:
Authenticating users from Azure AD
Previously, Azure AD did not support SAML 1.1 tokens required by SharePoint for authentication, and ACS was used as an intermediary that made SharePoint compatible with Azure AD token formats. Now, you can connect SharePoint directly to Azure AD using token issuance policies.
App authentication & server-to-server authentication in SharePoint on-prem or SharePoint Online – SharePoint add-in registrations done through appregnew.aspx etc.
Not affected by ACS retirement; no changes necessary.
Low trust authorization for SharePoint add-ins (provider hosted and SharePoint hosted)
Not affected by ACS retirement; no changes necessary.
SharePoint cloud hybrid search
Not affected by ACS retirement; no changes necessary.
We had the same issue when using app-only, ClientID / ClientSecret based authentication in a tenant, that was recently created. In our old tenant (created in 2013) we could use the same authentication method without any problem. As it turned out, new tenants have a standard setting in DisableCustomAppAuthentication property, that disable this kind of auth., however it can be overriden using this command:
Set-SPOTenant -DisableCustomAppAuthentication $false
Source:
https://sharepoint.stackexchange.com/questions/284402/sharepoint-online-authorization-issue-token-type-is-not-allowed
https://sharepoint.stackexchange.com/questions/286693/getting-invalid-request-token-type-is-not-allowed-error-while-accessing-lists
Furthermore:
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azureacs
Azure Access Control (ACS), a service of Azure Active Directory (Azure
AD), has been retired on November 7, 2018. This retirement does not
impact the SharePoint Add-in model, which uses the
https://accounts.accesscontrol.windows.net hostname (which is not
impacted by this retirement). For more information, see Impact of
Azure Access Control retirement for SharePoint Add-ins. For new
tenants, apps using an ACS app-only access token is disabled by
default. We recommend using the Azure AD app-only model which is
modern and more secure. But you can change the behavior by running
‘set-spotenant -DisableCustomAppAuthentication $false' (needs the
latest SharePoint admin PowerShell).
More details:
https://www.koskila.net/literally-breaking-changes-to-app-authentication-on-sharepoint-%F0%9F%98%B5/

Using Azure AD as a authentication provider for Azure B2C

I have an angular-cli (v8) web application where I want users to be able to sign-in using their existing Azure AD account.
I came across the article explaining how to added authentication to an angular 8 application using Azure B2C and started to follow the step outlined in that article. https://about-azure.com/using-azure-ad-b2c-with-angular-8/
Azure AD is not on the list of authentication providers
Is is possible to add Azure AD as an authentication provider?
Technically my application is an Service Fabric application using .net core 3.1. I know that Visual Studio offers and "Add Connect Services" where one can choose Azure AD.
That does not work, because it configures authentication for a MVC application (options use.MVC) and I do not have an MVC application so it doesn't work (I have tried)
Is is possible to add Azure AD as an authentication provider?
Yes, you need to select New OpenID Connect provider and configure Azure AD as an identity provider.
Reference:
Set up sign-in for a specific Azure Active Directory organization in Azure Active Directory B2C

Azure AD (creating custom multi factor authentication instead of using the one provided by Azure)

I am developing an application which uses Azure AD as authentication provider.
Need to implement a two factor authentication for the application.
Is it possible to create our own provider and plugin into azure without using the one available with Azure AD.
As far as I know, the Azure AD doesn't support to use the third-party MFA authentication provider.
However we are also could build multi-factor authentication into custom apps with Azure AD. More detail about this you can refer this document.

Resources