Skip to content
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

Documentation seems to mention that client's add-in code sends refresh token #3413

Open
kasturgo opened this issue May 9, 2022 · 2 comments
Assignees
Labels
Area: authentication Feedback on authentication content Needs: attention 👋 Waiting on Microsoft to provide feedback Status: in backlog Issue is being tracked in the backlog but timeline for resolution is unknown Type: doc bug Problem with the documentation (e.g., doc is out of date, unclear, confusing, or broken)

Comments

@kasturgo
Copy link

kasturgo commented May 9, 2022

Under Authorize the backend Web API below is what is mentioned
"Once the flow completes, the add-in sends the refresh token to the backend Web API and includes the SSO token (if available) or the Exchange identity token."

As far as I know if we use Implicit flow, we don't get refresh token and if we use Authorization code grant flow, we will not need to send refresh token to client and then send it back to client as the refresh token is already available on the webapi. Need some clarification around this.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@ghost ghost added the Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP label May 9, 2022
@AlexJerabek
Copy link
Collaborator

Thanks for reporting this @kasturgo.

@davidchesnut, I know you're working on this currently, but you could please provide clarification here.

@AlexJerabek AlexJerabek added Area: authentication Feedback on authentication content Type: doc request Request for new documentation or updates/enhancements to existing documentation Needs: attention 👋 Waiting on Microsoft to provide feedback and removed Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP labels May 9, 2022
@davidchesnut davidchesnut added Type: doc bug Problem with the documentation (e.g., doc is out of date, unclear, confusing, or broken) Status: in backlog Issue is being tracked in the backlog but timeline for resolution is unknown and removed Type: doc request Request for new documentation or updates/enhancements to existing documentation labels May 21, 2022
@davidchesnut
Copy link
Member

Hi @kasturgo,

Thanks! You are correct. I marked this as a doc bug and will make some updates to this article. As you point out you do not need to use implicit flow. The text is a bit confusing, but basically you need to call getAccessToken() to get the access token to your web server from Office SSO. When you call any APIs on your web server you pass this access token so that your web server can validate the signed in user (token validation.) Office caches the token so whenever you need it just call getAccessToken() again. If the server method requires Graph or other resources, it uses the On-Behalf-Of (OBO) flow to acquire a new token to that resource. The web server can cache any tokens using MSAL library caching so that subsequent requests will run efficiently.

Hope this helps!
David

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: authentication Feedback on authentication content Needs: attention 👋 Waiting on Microsoft to provide feedback Status: in backlog Issue is being tracked in the backlog but timeline for resolution is unknown Type: doc bug Problem with the documentation (e.g., doc is out of date, unclear, confusing, or broken)
Projects
None yet
Development

No branches or pull requests

3 participants