Authing DocsDocuments
Concept
workflow
Guides
Development Integration
Application integration
Concept
workflow
Guides
Development Integration
Application integration
Old Version
Development Integration
  • Single Sign-On (SSO)
  • Login component

  • JavaScript/Node.js

    • User Authentication Module

      • User authentication module
      • Standard agreement certification module
      • Scan code login module
      • Multi-factor authentication module
      • Social login module
      • Corporate identity source login module
      • Main authentication module
    • Management Module

  • Java / Kotlin

  • Python

  • C#

  • PHP

  • Go

  • Ruby
  • Android

  • iOS

  • Flutter

  • React Native
  • WeChat Mini Program
  • WeChat webpage authorization
  • Framework Integration
  • Error code
  1. Development Integration
  2. /
  3. JavaScript/Node.js
  4. /
  5. User Authentication Module
  6. /
  7. Corporate identity source login module

¶ Corporate identity source login module

Update Time: 2025-02-18 09:00:47
Edit

This module encapsulates the functionality of the corporate identity source, which can quickly use the corporate identity source to log in to obtain user information through a simple API.

Running a corporate identity source login authorization request:

import { AuthenticationClient } from 'authing-js-sdk'
const authenticationClient = new AuthenticationClient({
  appId: 'AUTHING_APP_ID',
  appHost: 'https://xxx.authing.cn',
})
await authenticationClient.enterprise.authorize('oidc', 'xxxx', {
  onSuccess: (user) => {
    console.log(user)
  },
  onError: (code, message) => {},
})

¶ Send an authorized login request

EnterpriseAuthenticationClient().authorize(provider, identifier, options)

Send an authorized login request, this method will open a new window directly, jump to the login authorization page of the corporate identity source provider (such as OIDC, SAML service provider, etc.), after the user completes the authorization, and triggered onSuccess Running function, through this function, you can get user information.

¶ parameter

  • provider <string> Corporate logo identity source service providers.
  • identifier <string> The unique identifier of the corporate identity configured in Authing.
  • options <object> Window.Open.
  • options.popup <boolean> Whether to open the corporate identity source login window by pop-up, if set to false, a new browser Tab will be opened in window.open, the default is: true.
  • options.onSuccess <Function>The user agrees to authorize the event callback function, the first parameter is user information.
  • options.onError <Function> Social login failed event callback function, the first parameter code is an error code, the second parameter message is an error message. See the detailed error code list: See you detailed: See you:Authing Error code list
  • options.position <object> Only when options.popup is time, the location of the window is popped up, default{ w: 585, h: 649 } .

¶ Example

// Log in with SAML service provider

const authenticationClient = new AuthenticationClient({
  appId: 'AUTHING_APP_ID',
  appHost: 'https://xxx.authing.cn',
})

await authenticationClient.enterprise.authorize('saml', 'xxxx', {
  onSuccess: (user) => {
    console.log(user)
  },
  onError: (code, message) => {},
  // Customize the location of the pop-up window
  position: {
    w: 100,
    h: 100,
  },
})
// Use the form of the new browser tab open source enterprise identity login page

const authenticationClient = new AuthenticationClient({
  appId: 'AUTHING_APP_ID',
  appHost: 'https://xxx.authing.cn',
})

await authenticationClient.enterprise.authorize('saml', 'xxxxx', {
  popup: false,
  onSuccess: (user) => {
    console.log(user)
  },
  onError: (code, message) => {},
})
Prev: Social login module Next: Main authentication module
  • Send an authorized login request

User identity management

Integrated third-party login
Mobile phone number flash check (opens new window)
Universal login form component
Custom authentication process

Enterprise internal management

Single Sign On
Multi-factor Authentication
Authority Management

Developers

Development Document
Framework Integration
Blog (opens new window)
GitHub (opens new window)
Community User Center (opens new window)

Company

400 888 2106
sales@authing.cn
16 / F, Block B, NORTH STAR CENTURY CENTER, Beijing(Total)
room 406, 4th floor, zone B, building 1, No. 200, Tianfu Fifth Street, Chengdu(branch)

Beijing ICP No.19051205-1

© Beijing Steamory Technology Co.