-
Notifications
You must be signed in to change notification settings - Fork 694
Create sample that shows how to integrate with Azure Active Directory ( AAD ) #494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I have a sample that works with google sso. But it looks like the return url does contain a valid id_token. |
We will write something down regarding ADFS and Azure AD. For the time beeing, you might find the following snippet from a real-world project useful. All those things can also be configured within an config-object passed to .configure(...).
Another thing to consider is that you have to configure two apps/resources in your Azure AD: The client (Angular app) and the Backend. |
Hi manfredsteyer, Thank you for the library. I used to create an Ionic App and worked very well. Do you have success to write an example using AAD? I am struggling to understand the different URLs that Azure provides in the configuration and how to use them using your last sample code posted here. In my app, I am getting a valid token and sending to the API, and there I am validating using the .Net Core JWT authentication.
|
I think that this is needed: |
When I tried the scope per your comment, azure is reporting: |
|
Here is my extremely simple Login button for Azure: https://github.com/mores/angular-examples/tree/master/oidc-azure I update src/app/app.component.ts with my guid tenant - and my client id After hitting the login button, the url that shows in my browser is in the form of I have gotten back valid tokens from Azure. Console shows: has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Any help is appreciated. |
If you get a CORS error, is there also a failed request in the network tab of your dev tools? What host is it trying to reach? If you could also add this gist's code way up early in your code, then you'd also get some additional logging you could share, so we can know what bit of logic in the library is causing the CORS request. |
I do not see any errors in the network tab. There are two OAuthErrorEvent type: "discovery_document_load_error" It is having issues with this url: https://login.microsoftonline.com/ < enter guid here>/discovery/v2.0/keys |
I now understand what @manfredsteyer was trying to say in his comment above.... |
Other people are having issues validating token too: microsoft/azure-spring-boot#476 I am able to verify the idToken but not the accessToken. Looking to see if Microsoft can shed any light here: |
Currently, I made it work with Azure B2C with the following setup:
I also had to use the PR #527 from @ismcagdas. Otherwise the flow fails. Furthermore, to validate the tokens, I adapted the JwkValidationHandler to first fetch the keys from a configured URL, though nothing complicated. Hope this helps. |
I think I found out what "special processing" means: |
I think I have a good working example now: https://github.com/mores/angular-examples/tree/master/oidc-azure |
They seem to have enabled CORS for their jwks endpoint now. Best to switch over or get caught out like we did with a cached copy of the old keys. |
I am totally new in OIDC and need to use OIDC with Azure active directory. Does any one have a working example where no Identity server is required. I tried Mores's example but it also need a 'PRIVATE_PROXY_SERVER'. |
Where did you get the issuer url in the portal? |
If you open 'https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration' (the standard OIDC discovery endpoint) you get all the JSON data for their configuration. Replace 'common' with your Azure tenant ID for more specific values. |
Hello @mores
So, I change it for:
And It started to work, so now everything is fine.. I'm going to adapt this to my actual project.. Thanks a lot! |
I wrote a blog post about how to use the component with Azure AD B2C: |
Does anyone have experience with the userinfo endpoint? |
Does anyone implement in Azure AD (not Azure B2C) with PCKE successfully? Thanks. |
It is known that Azure Active Directory endpoints do not allow Cross Origin Resourece Sharing (CORS).
Others have documented it is a PITA to integrate with Azure Active #135
Others got frustrated about Azure AD not respecting OIDC, so they switched to using their own library directly #126
The text was updated successfully, but these errors were encountered: