I am using the following configuration in my rocketchat server
Token Path: /oauth2/token
Token Sent Via: Payload
Identity Token Sent Via: Header
Identity Path: /openid/userinfo
Authorize Path: /oauth2/authorize
Scope: openid profile email
Param Name for access token: access_token
Id / Secret: copied
Login Style: Redirect
Key Field: Email
I am able to login using my microsoft account when I login through the rocket chat server address.
When I try to use the login api as part of my node project according to the docs
https://developer.rocket.chat/v1-api/apidocs/login-with-username-and-password
sending the accesstoken (for which the scope is myApi), servicename=âmicrosoftâ and expiresIn parameter, I get a 400 bad request error from the /openid/userinfo.
(Invalid audience)
I tried replacing the identity path to https://graph.microsoft.com/oidc/userinfo
but then I get an error since my token doesnât fit graph.
I would like to get the original configuration to work with the login api.
Is that possible?
Would appreciate your assistance realizing why I am getting a bad request error.
âFailed to fetch identity from microsoft at
https ://login.microsoftonline.com/<tenant_id>/openid/userinfo. failed [400]â