generator-office icon indicating copy to clipboard operation
generator-office copied to clipboard

wrong request url when calling await sso.getGraphToken(bootstrapToken);

Open arozwalak opened this issue 5 years ago • 2 comments

I'm working on outlook addon and I'm having problem with sso.getGraphToken(bootstrapToken) call. I'm service addon from AWS S3 bucket which is behind nginx proxy. When I call getGraphToken(bootstrapToken) it's sending request to `https://my_app_domain/auth?_=1605895039463 which is wrong as such path doesn't exists.

I think that /auth should be called from Microsoft domain instead to get graphToken. What am I doing wrong and how can I fix that?

thanks

arozwalak avatar Nov 20 '20 18:11 arozwalak

when I added 'graph.microsoft.com' as a domain to /auth request (https://graph.microsoft.com/v1.0/auth?_=1606130673915) I'm getting this response

{ "error": { "code": "InvalidAuthenticationToken", "message": "Access token validation failure. Invalid audience.", "innerError": { "date": "2020-11-23T11:24:34", "request-id": "7699605a-1f1a-472a-913a-2efec2829b5e", "client-request-id": "7699605a-1f1a-472a-913a-2efec2829b5e" } } }

arozwalak avatar Nov 23 '20 11:11 arozwalak

sso.getGraphToken() calls the API hosted in node server to get access token, which is not running in your system. If you don't want to run that server, but use your own APIs, you can do that as documented here -> https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow#request-an-access-token-with-a-client_secret

gaurav2493 avatar Jun 23 '21 09:06 gaurav2493

The SSO template has been significantly revamped. Please look at it for a sample of a functional case.

millerds avatar Mar 22 '23 19:03 millerds