signInOAuth()

Description

Sign in with a selected OAUTH provider

Request

Parameters

Field
Required
Data Type
Description

providerId

string

google.com, facebook.com, or github.com

sessionId

string

callBackUri

string

URL to redirect users after a successful OAUTH sign-in.

token

string

Used only for Google and Facebook sign-in.

If the token is provided, code parameter is ignored.

code

string

Example

const signInWithOAuth = await client.auth().signInOAuth('google.com', 'kasdoa0123-012sdasd', 'http://localhost/sign-in-oauth', 'asdkmaskdsadmapoin0i', '0aksd09d0jd091ij0')

Response

Parameters

Field
Data Type
Description

providerId

string

google.com, facebook.com, or github.com

localId

string

User email

email

string

User password

emailVerified

boolean

Whether the user has verified their email by following the link sent to their email.

rawUserInfo

string

The stringified JSON response containing all the IdP data corresponding to the provided OAuth credential.

idToken

string

firstName

string

User first name if present in OAUTH provider

lastName

string

User last name if present in OAUTH provider

fullName

string

User full name if present in OAUTH provider

displayName

string

User display name if present in OAUTH provider

photoUrl

string

User photo if present in OAUTH provider

refreshToken

string

expiresIn

string

How long the token is valid for (in seconds).

needConfirmation

boolean

Whether another account with the same credential already exists. The user will need to sign in to the original account and then link the current credential to it.

Example

{
    "data": {
        "providerId": "google.com",
        "localId": "a9nsiasjdi1d9wd1dwm9w1wd",
        "emailVerified": true,
        "email": "example@example.org",
        "rawUserInfo": "",
        "firstName": "Johnathan",
        "lastName": "Doe",
        "fullName": "Johnathan Doe",
        "displayName": "John Doe",
        "photoUrl": ""
        "idToken": "eyJahbGciOiJSUzI1NiIsImtpZCI6IjUwYTdhYTlkNzg5MmI1MmE4YzgxMzkwMzIzYzVjMjJlMTkwMzI1ZDgiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL3NlY3VyZXRva2VuLmdvb2dsZS5jb20vZGVza3JlZS1mYzY3ODUyYy1jYTRlLTQ4MTQtYSIsImF1ZCI6ImRlc2tyZWUtZmM2Nzg1MmMtY2E0ZS00ODE0LWEiLCJhdXRoX3RpbWUiOjE2NTc1NTc2MzEsInVzZXJfaWQiOiJpOVhVWEo1QXJEUFlHeTkwc0VYdU5LVWliaEczIiwic3ViIjoiaTlYVVhKNUFyRFBZR3k5MHNFWHVOS1VpYmhHMyIsImlhdCI6MTY1NzU2NzA3MiwiZXhwIjoxNjU3NTcwNjcyLCJlbWFpbCI6ImJpbWV4aXM0NjNAbGV1cHVzLmNvbSIsImVtYWlsX3ZlcmlmaWVkIjpmYWxzZSwiZmlyZWJhc2UiOnsiaWRlbnRpdGllcyI6eyJlbWFpbCI6WyJiaW1leGlzNDYzQGxldXB1cy5jb20iXX0sInNpZ25faW5fcHJvdmlkZXIiOiJwYXNzd29yZCJ9fQ.noxnUOenJmxaGbm9gKq_tZQoWAPwvRDEKpxHJ3gLfd-mzWWs3AqHXlqYvtV7jtlJDIuHisTk5MQeugRiUjVaN0RHuraFMO9gSpuv4-7roIjVRpp7GoFPHRjdzge8WMBM-obtsDC-D1QhjvCXqXcvmbcFS2ej1zbHDvANncOQckXxGdT0dFHIiZGWmUqMnUxKpWuiYhsci7Odf7TWiKUPFuGrzCBV2QbA8veAklNdIAHmbAvwFFnJtl8A4FsOYbwpmr-TB3RFBWBo1SzZUzyzLb4ffbV4k5Monkp3i1mqRphByLiynrkKohPa0sLun2jjbXRHK6iPQOKPYaFNHaxbDQ"
        "refreshToken": "AIwUaOn0QXtzI0f_DbKca7QfoHnKhSlswIHoOuL5Hsrg-UGePN5aQID6giYWkvyMlLCk-67pVxNXC5yvoMuvhsTLab6FkSaCM2zK4vwxWplCAjMuTI_Ux7CVl3tTSexEjGd6NZQuNeKHYlI8zWPBLW4bvGtJ1Tc6NwpvIKRAi_ZNDl9Zcir0UDQQp_LPTuQu58F2ZIetfeG_oZB5rDbmo3F7uKOtsDihtywnZYHZm1C7E-Qp7GEWBc8",
        "expiresIn": "3600",
        "needConfirmation": true
    }
}

Last updated

Copyright © 2023 Deskree Technologies Inc.