Logging into Azure Ad with Cypress

I managed to solve the Azure AD login by creating the following Cypress custom command: Cypress.Commands.add(‘login’, () => { return cy .request({ method: ‘POST’, url: `https://login.microsoftonline.com/${tenantId}/oauth2/token`, form: true, body: { grant_type: ‘password’, tenant: ‘tenantId’, client_id: ‘clientId’, client_secret: ‘clientSecret’, username: ‘username’, password: ‘password’, resource: ‘clientId’, }, }) .then((response) => { sessionStorage.setItem(‘access_token’, response.body.access_token); }); }); Then you … Read more

Azure authentication Audience validation failed

I’m afraid the issue comes from the auth configuration in startup. Pls allow me show my code snippet to explain it well. In my opinion, you could use services.AddMicrosoftIdentityWebApiAuthentication(Configuration); instead. And you should exposed the api correctly. The steps of exposing api, you can follow the documents. What I wanna repeat here is when you … Read more

Azure Portal: Bad Request – Request Too Long

The error HTTP 400: Size of header request is too long generally happens because there’s too many cookies or cookies that are too big. Azure AD B2C’s login goes through login.microsoftonline.com, as does almost every Microsoft service (O365, Azure, etc). So if you’ve got several accounts that you’ve signed in to across these services, you’re … Read more

Error making Azure Management Library API call when authenticating with azure active directory

I believe you’re on the right track as to why you’re running into this problem. Here’s what’s happening: Essentially permission to execute Service Management API is a delegated permission and not an application permission. In other words, the API is executed in context of the user for which the token is acquired. Now you are … Read more

Which Graph API should be used with Azure AD B2C

As of today, we recommend that you use the Azure Active Directory Graph API https://graph.windows.net to access and manage your B2C tenants. Azure AD B2C: Use the Graph API If you read this article, you can learn more about the gaps between AAD and Microsoft Graph API: https://dev.office.com/blogs/microsoft-graph-or-azure-ad-graph The bottom line in the table states: … Read more