Hi! I'm trying to make an authentication via mail.ru. According to the documentation, it is necessary to include access_token into the request for user information. Is it possible to addaccess_tokento profileUrl like this https://oauth.mail.ru/userinfo?access_token=8e41b7a475aa7691aeead06ef0db28f989fbab0c37363830?
The access token is automatically added to the profileUrl. So it should work without it.
But metadata shows:
{
error: 'invalid request',
error_code: 2,
error_description: 'missing request parameter: access_token'
}
Hmm, can you share your provider details? (minus Client ID/Secret)?
Maybe we need to do something special for this provider - a small number of providers have uncommon implementations and require specific hacks to support (e.g. Okta, Twitch).
export default (options) => {
return {
id: 'mailru',
name: 'Mail.ru',
type: 'oauth',
version: '2.0',
scope: 'userinfo',
params: { grant_type: 'authorization_code' },
accessTokenUrl: 'https://oauth.mail.ru/token',
requestTokenUrl: 'https://oauth.mail.ru/token',
authorizationUrl: 'https://oauth.mail.ru/login?response_type=code',
profileUrl: 'https://oauth.mail.ru/userinfo',
profile: (profile) => {
return {
id: profile.id,
name: profile.name,
email: profile.email,
image: profile.image,
};
},
...options,
};
};
Error:

Thanks! Will take a look later.
Also, built-in support for Mail.ru has been added.
Closing this issue as the PR is basically completed and the discussion as moved there (https://github.com/nextauthjs/next-auth/pull/522)