oauthSignUp
User registration (authorization) via OAUTH. It returns a Promise that resolves to an IAuthEntity object.
Description
Method accepts the body as a parameter.
AuthProvider.oauthSignUp(
marker,
body,
body.client_id,
body.client_secret,
body.code,
body.grant_type,
body.redirect_uri,
langCode
);
Parameters schema
Schema
marker(required): string
The text identifier of the authorization provider
example: "email"
body(required): IOAuthSignUpData
Object contains OAuth information for registration
example:
{
"client_id": "34346983-luuct343473qdkqidjopdfp3eb3k4thp.apps.googleusercontent.com",
"client_secret": "43434343434",
"code": "4/0AVMBsJgwewewewewewei4D7T6E_fbswxnL3g",
"grant_type": "authorization_code",
"redirect_uri": "http://localhost:3000"
}
body.client_id(required): string
The client ID for the OAuth application.
example: "34346983-luuct343473qdkqidjopdfp3eb3k4thp.apps.googleusercontent.com"
body.client_secret(required): string
The client secret for the OAuth application.
example: "43434343434"
body.code(required): string
The authorization code received from the OAuth provider.
example: "4/0AVMBsJgwewewewewewei4D7T6E_fbswxnL3g"
body.grant_type(required): string
The grant type for the OAuth request.
example: "authorization_code"
body.redirect_uri(required): string
The redirect URI for the OAuth application.
example: "http://localhost:3000"
langCode: string
Language code. Default: "en_US"
example: "en_US"
Examples
Minimal example
const body = {
"client_id": "34346983-luuct343473qdkqidjopdfp3eb3k4thp.apps.googleusercontent.com","client_secret": "43434343434","code": "4/0AVMBsJgwewewewewewei4D7T6E_fbswxnL3g","grant_type": "authorization_code","redirect_uri": "http://localhost:3000"}
const response = await AuthProvider.oauthSignUp('email', body)