Access Token not passed to UserInfo #2713
-
I'm creating a custom provider and have found that when I return a data object back from the request method inside of token, those tokens are then not padded to the user info object, notably the request method inside of that object. I am using function Combine(): OAuthConfig {
return {
id: 'combine',
name: 'Combine',
type: 'oauth',
clientId: '[REDACTED]',
clientSecret: '[REDACTED]',
authorization: {
url: 'https://example.com/ws/oauth2/auth/',
params: {
client_id: '[REDACTED]',
client_secret: '[REDACTED]',
response_type: 'code',
scope: 'character_read'
}
},
token: {
url: 'https://example.com/ws/oauth2/token/',
async request(tokens) {
const params = new URLSearchParams();
params.append('code', tokens.params.code ? tokens.params.code : '');
params.append('client_id', '[REDACTED]');
params.append('client_secret', '[REDACTED]');
params.append('redirect_uri', 'http://localhost:3000/api/auth/callback/combine');
params.append('grant_type', 'authorization_code');
const response = await axios.post('https://example.com/ws/oauth2/token/', params, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Accept': 'application/json'
}
});
console.log(response.data);
return response.data;
},
},
userinfo: {
url: 'https://examplecom/ws/v2.0/character/',
async request(tokenSet: TokenSet) {
// tokenSet param is null on the tokenSet.token
console.log(tokenSet);
return {
}
}
},
...... Screen shot of the Screen shot of the Any ideas? I was initially following #1846 then had to go and hunt around inside the code. Once this can be figured out, I'm more than happy contributing to some documentation! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The - return response.data
+ return { tokens: response.data } |
Beta Was this translation helpful? Give feedback.
The
request
method intoken
expects you to return atokens
object. So simply change: