-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
I get 500 Internal Server Error when logging with Custom Oauth provider #4535
Comments
@dalareo Did you find a solution for this problem? I am running into a similar issue using a custom OAUTH with WSO2IS. Many thanks! |
Can you please give us the steps to replicate this? Or even a test environment? |
@engelgabriel Thanks for your quick answer! I gathered some more informations which i will provide soon. |
@engelgabriel The problem (in my environment) is that Rocket.Chat sends both Authorization Header and ClientId + ClientSecret in the body on the token request (https://github.com/RocketChat/Rocket.Chat/blob/master/packages/rocketchat-custom-oauth/custom_oauth_server.js#L81-L95). This works: response = HTTP.post(this.tokenPath, {
auth: config.clientId + ':' + OAuth.openSecret(config.secret),
headers: {
Accept: 'application/json',
'User-Agent': this.userAgent
},
params: {
code: query.code,
//client_id: config.clientId,
//client_secret: OAuth.openSecret(config.secret),
redirect_uri: OAuth._redirectUri(this.name, config),
grant_type: 'authorization_code',
state: query.state
}
}); And this works: response = HTTP.post(this.tokenPath, {
//auth: config.clientId + ':' + OAuth.openSecret(config.secret),
headers: {
Accept: 'application/json',
'User-Agent': this.userAgent
},
params: {
code: query.code,
client_id: config.clientId,
client_secret: OAuth.openSecret(config.secret),
redirect_uri: OAuth._redirectUri(this.name, config),
grant_type: 'authorization_code',
state: query.state
}
}); The original code with Authorization Header and ClientId + ClientSecret in the body does not work with WSO2 Identity Server 5.3.0-rc3 (https://github.com/wso2/product-is/tree/v5.3.0-rc3) Here is the spec https://tools.ietf.org/html/rfc6749#section-2.3. "The client MUST NOT use more than one authentication method in each request." In our opinion the Rocket.Chat implementation seems to be wrong at this point. Thanks for your Feedback! |
Can anybody give me a Feedback? The solution i can provide is a configuration option if the authorization params (authorization header or client_id + client_secret param) will send in header or body. OK? |
Hello, By default, client_id & secret should be only available in header, and not using params. By reading the RFC :
You may use the "tokenSentVia" parameter to define if client_id+secret should be sent using header or query param, but from my point of view, it should always be sent only using header Authorization... PS : If you release an rc on docker, we can test it very quickly ;) Regards, |
I get:
When trying to log in using custom oauth (WSO2is). No problem if I use Wordpress Oauth.
The text was updated successfully, but these errors were encountered: