-
Notifications
You must be signed in to change notification settings - Fork 21
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
Added support for access tokens for use with implicit auth flow against AAD and Office365 #26
Conversation
wow impressive commit !! I would very much like to document support for access token. To be able to do that I would like you to document the 'data'. For that I would like you add your data to the a.production.xxxx classes and have them exported as consts. inside 'a.production.adal.config.ts' 2 things:
Also inside a.production.aad.response.ts 2 things
|
Fixed logout behavior when using access tokens.
Thanks. :) I've added the consts you requested now. Please have a look and check if it looks ok. The ATenantConfig_AccessToken uses a SharePoint resource as an example, but could be any AAD resource, like Microsoft Graph, etc. Also, in order for implicit authentication to work with an AAD Client ID, you need to edit the app manifest in AAD to allow this ("oauth2AllowImplicitFlow": true). Of course, you also need to assign the appropriate permissions to the app, in my case, I've assigned the permission "read items in all site collections" on the "Office 365 SharePoint Online" app. |
thx very much. I got it published to npm. |
Hi @Chipzter and @HNeukermans, Sorry I'm kind of new to all of this. I was able to retrieve an ID Token with this code:
However, if I understood well in order to get an access token I'd be needing to do that to my AdalConfig?
But I still get an id token. Could you kindly give me some instructions, please? For now all I want to do is to get an access token and use fiddler to query Graph: https://graph.microsoft.com/v1.0/me, that's all. Thanks so much. |
Hi, disregard my last message. I've found out he solution, THANK YOU so much @Chipzter the access token is crucial for my business application. As you mentioned, I had to:
|
Hi @evnexus |
This way the developer can specify "token" as response_type in the AdalConfig object. To get an access token to Office365 one also needs to add a "resource=http://company.sharepoint.com" parameter using the extraQueryParameter property. Since the returned access token returns everything that's being parsed by the userDecoder, I'm using the idToken by default with accessToken as a fallback.