Vulos Documentation
  • Identity
    • Welcome to the Vulos Identity Documentation!
    • Quick Start
    • Organizations
    • Scopes and Claims
  • Reference
    • Identity JavaScript SDK
      • The Base Package
        • KYC
          • KycStatus
          • KycInstance
          • KycDetails
          • KycApi
        • Profile
          • UserReference
          • ProfileApi
        • Cache
        • Authentication
          • Application
          • BaseAuth
          • User
          • UserInfo
          • BaseApi
        • Organizations
          • Organization
          • OrganizationMembership
            • OrganizationMembershipWithMetadata
          • OrganizationRole
          • OrganizationApi
      • The Backend Auth Package
        • CodeVerifier
        • BackendAuth
      • The Frontend Auth Package
        • IFrameRefresh
        • StateVerifier
        • FrontendAuth
    • Organization API
      • Organizations
      • Memberships
        • Roles
    • Profile API
    • KYC API
Powered by GitBook
On this page
  • Members
  • id : string
  • secret : string?
  • scope : string
  • responseTypes : string[]
  • redirectUrls : string[]
  • postLogoutRedirectUrls : string[]?
  • Methods
  • constructor(config)
  • createAuth(authApi, endpoint?)
  1. Reference
  2. Identity JavaScript SDK
  3. The Base Package
  4. Authentication

Application

PreviousAuthenticationNextBaseAuth

Last updated 3 years ago

Members

id : string

The Client ID of this application.

secret : string?

The Client Secret of this application.

scope : string

The of this application.

responseTypes : string[]

The OpenID response types of this application.

redirectUrls : string[]

The OpenID redirect URLs of this application.

postLogoutRedirectUrls : string[]?

The OpenID post logout redirect URLs of this application.

Methods

constructor(config)

Create a Vulos Application object based on a configuration object that has the following properties:

  • id: string (required): The Client ID of the Application (you can obtain this from the Vulos Identity dashboard by creating an application);

  • secret: string: The Client Secret of the Application (you can obtain this from the Vulos Identity dashboard by creating an application, non-applicable for browser applications that use the implicit flow);

  • scope: string (required): The OIDC scopes - "permissions" that your application has, they must match your application in the Vulos Identity dashboard.

  • redirectUrls: string[] (required): The URLs where Vulos Identity redirects after a user interaction;

  • postLogoutRedirectUrls: string[]: The URLs where Vulos Identity redirects after a successful logout;

  • responseTypes: string[]: The OIDC response types (defaults to ['code'] if a client secret is provided);

const application = new Application({
    // this is an example Client ID, replace with your own
    id: "796FZE9KLOLO0VSSBNOE",
    // this is an example Client Secret, replace with your own
    secret: "5a9b30a4f2f7f5edb5087e2258c3ecc0fc4129853e28f2f48f10b21b60388f1f",
    // this is an example scope string, modify according to your needs
    scope: "openid offline_access organization:manage",
    
    // change these URLs to match your site or application
    redirectUrls: [ "http://localhost/callback/login" ],
    postLogoutRedirectUrls: [ "http://localhost/callback/logout" ],
    
    // https://openid.net/specs/oauth-v2-multiple-response-types-1_0.html
    responseTypes: [ "code" ]
})

createAuth(authApi, endpoint?)

If an endpoint argument is provided, that will be used instead of the default Vulos Identity endpoint.

// If you intend to use this code in the frontend, 
// use "FrontendAuth" from "@vulos/identity-browser-sdk"
import { BackendAuth } from "@vulos/identity-node-sdk"

// ...

const auth = application.createAuth(BackendAuth)

Create an authentication object for this application based on a constructor specified in authApi that's provided by or .

See for more information.

OpenID scope
@vulos/identity-browser-sdk
@vulos/identity-node-sdk
BaseAuth