[Node.js] Custom authentication (oAuth) for outlook using passport.js

GES PDC 6 Reputation points
2020-08-29T18:51:06.713+00:00

Hi,

When I trying to use Outlook login, I have folllowing bugs. I set up all the clientID, cliendSercret and redirect_url and I am using passport-outlook.

AuthorizationError: The request is not valid for the application's 'userAudience' configuration. In order to use /common/ endpoint, the application must not be configured with 'Consumer' as the user audience. The userAudience should be configured with 'All' to use /common/ endpoint.

at Strategy.OAuth2Strategy.authenticate (D:\PDCeventBoard\node_modules\passport-oauth2\lib\strategy.js:137:25)
at attempt (D:\PDCeventBoard\node_modules\passport\lib\middleware\authenticate.js:366:16)
at authenticate (D:\PDCeventBoard\node_modules\passport\lib\middleware\authenticate.js:367:7)
at Layer.handle [as handle_request] (D:\PDCeventBoard\node_modules\express\lib\router\layer.js:95:5

Community Center | Not monitored
{count} vote

1 answer

Sort by: Most helpful
  1. JeffYang-MSFT 6,261 Reputation points Moderator
    2020-08-31T08:32:05.84+00:00

    Hi @GES PDC ,

    When I trying to use Outlook login, I have folllowing bugs. I set up all the clientID, cliendSercret and redirect_url and I am using passport-outlook.

    It seems you are using Outlook client programmatically, right?
    If so, can you successfully log in via Outlook desktop client directly? If you can successfully log in via Outlook desktop client but have issues via script method, I’m afraid that your issue is more related to your script code.

    Since here we mainly focus on general issues about Outlook desktop client and Outlook development is currently not supported in the Q&A forums, it is suggested to post a new thread to the dedicated forum for Outlook for developers over here: https://social.msdn.microsoft.com/Forums/office/en-US/home?forum=outlookdev&filter=alltypes&sort=firstpostdesc

    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thanks for your understanding and hope your question will be resolved soon.


    If the response is helpful, please click "Accept Answer" and upvote it.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.