Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "src/rest/oauth"

Index

Functions

Const getRedirectUri

  • getRedirectUri(service: string): string
  • Parameters

    • service: string

    Returns string

Const loginWithOAuth2Service

  • loginWithOAuth2Service(service: string, name: string, email: string, locals: Locals): Promise<LoginResponse>
  • Parameters

    • service: string
    • name: string
    • email: string
    • locals: Locals

    Returns Promise<LoginResponse>

Object literals

Const facebook

facebook: object

client

client: ClientOAuth2 = new ClientOAuth2({clientId: FACEBOOK_CLIENT_ID,clientSecret: FACEBOOK_CLIENT_SECRET,redirectUri: getRedirectUri("facebook"),authorizationUri: "https://www.facebook.com/v3.3/dialog/oauth",accessTokenUri: "https://graph.facebook.com/v3.3/oauth/access_token",scopes: ["email"]})

callback

  • Parameters

    Returns Promise<LoginResponse>

Const github

github: object

client

client: ClientOAuth2 = new ClientOAuth2({clientId: GITHUB_CLIENT_ID,clientSecret: GITHUB_CLIENT_SECRET,redirectUri: getRedirectUri("github"),authorizationUri: "https://github.com/login/oauth/authorize",accessTokenUri: "https://github.com/login/oauth/access_token",scopes: ["read:user", "user:email"]})

callback

  • Parameters

    Returns Promise<LoginResponse>

Const google

google: object

client

client: ClientOAuth2 = new ClientOAuth2({clientId: GOOGLE_CLIENT_ID,clientSecret: GOOGLE_CLIENT_SECRET,redirectUri: getRedirectUri("google"),authorizationUri: "https://accounts.google.com/o/oauth2/v2/auth",accessTokenUri: "https://www.googleapis.com/oauth2/v4/token",scopes: ["https://www.googleapis.com/auth/userinfo.email"]})

callback

  • callback(url: string, locals: Locals): Promise<object>
  • Parameters

    Returns Promise<object>

Const microsoft

microsoft: object

client

client: ClientOAuth2 = new ClientOAuth2({clientId: MICROSOFT_CLIENT_ID,clientSecret: MICROSOFT_CLIENT_SECRET,redirectUri: getRedirectUri("microsoft"),authorizationUri:"https://login.microsoftonline.com/common/oauth2/authorize",accessTokenUri: "https://login.microsoftonline.com/common/oauth2/token",scopes: ["user.read", "mail.read"]})

callback

  • Parameters

    Returns Promise<LoginResponse>

Const salesforce

salesforce: object

client

client: ClientOAuth2 = new ClientOAuth2({clientId: SALESFORCE_CLIENT_ID,clientSecret: SALESFORCE_CLIENT_SECRET,redirectUri: getRedirectUri("salesforce"),authorizationUri: "https://login.salesforce.com/services/oauth2/authorize",accessTokenUri: "https://login.salesforce.com/services/oauth2/token",scopes: ["id"]})

callback

  • Parameters

    Returns Promise<LoginResponse>

Generated using TypeDoc