-
Notifications
You must be signed in to change notification settings - Fork 35
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
Support for Refresh Token #10
base: master
Are you sure you want to change the base?
Conversation
Thanks for the PR 👍 There looks to be quite a lot of change unrelated to the feature you are adding. From what I can tell we shouldn't need to update any dependencies or the Would you mind reverting those changes and confirming the feature still works? |
defp defaults(config) do | ||
tenant_id = config[:tenant_id] || "common" | ||
|
||
[ | ||
strategy: __MODULE__, | ||
site: "https://graph.microsoft.com", | ||
site: "https://login.microsoftonline.com/#{tenant_id}/oauth2/v2.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think https://graph.microsoft.com
is the correct value for site
as this describes the site we're authenticating to get access to. The https://login.microsoftonline.com/
URL is only used for carrying out the authentication.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tokens are refreshed by submitted a POST request to /token of the endpoint, which is "https://login.microsoftonline.com/#{tenant_id}/oauth2/v2.0". The OUATH refresh strategy concats the site and token opts opts to derive the endpoint URI.
The "https://graph.microsoft.com" endpoint is for the GraphAPI itself after authentication.
authorize_url: "https://login.microsoftonline.com/#{tenant_id}/oauth2/v2.0/authorize", | ||
token_url: "https://login.microsoftonline.com/#{tenant_id}/oauth2/v2.0/token", | ||
token_url: "/token", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't able to get authentication working when only using /token
. Am I missing something here?
Whats the status of this one? |
Happy to get this merged, just needs a rebase and confirmation around the url change. |
Refreshing tokens is now supported. See docs fro more information.