OAuth Authentication

OAuth is an open standard that allows users to authorize third-party applications to access their information stored on a specific resource server without sharing usernames and passwords with the third-party applications.

This section describes how to integrate a third-party authentication provider with OneAccess through OAuth.

The procedure for accessing the user portal on a PC is used for illustration. Select and configure an application that meets your service requirements.

Configuration Process

Figure 1 Configuration process

Prerequisites

You have permissions to access the administrator portal.

Establishing a Trust Between the Application and OneAccess

Configure authorization information for OneAccess in the application to establish a trust on OneAccess.

  1. Obtain the authentication information in OneAccess.

    1. Log in to the administrator portal.
    2. In the top navigation pane, choose Settings > Server Settings. Then click OIDC.
    3. On the OIDC page, view the authentication address.
    4. Click OIDC Discovery in the upper right and view the authentication parameters.

  2. Obtain the callback address in OneAccess. For details, see Table 1.
  3. Configure the preceding information in the application. For details, see the application provider's documentation.
  4. Obtain the authorization information of the application. For details, see the application provider's documentation.

Adding an OAuth Authentication Provider

Add an OAuth authentication provider and configure the application information in OneAccess.

  1. Log in to the administrator portal.
  2. In the top navigation pane, choose Authentication > Authentication Providers. Then click OAuth.

    Figure 2 OAuth

  3. On the OAuth Authentication Providers page, click Add Authentication Provider in the upper right corner and set the parameters required.

    Figure 3 Configuring parameters
    Table 1 Configuration parameters

    Parameter

    Mandatory

    Description

    Icon

    No

    Upload a PNG, JPG, or GIF image whose size does not exceed 50 KB. The recommended size is 32 x 32 pixels.

    Display Name

    Yes

    Display name of the authentication provider, for example, OAuth.

    clientId

    Yes

    Client ID of the application. Obtain the value from the application.

    clientSecret

    Yes

    Client secret of the application. Obtain the value from the application.

    Authentication Mode

    Yes

    Default value: authorization_code.

    Client Information Transfer

    Yes

    Options: basic and post.

    Token Transfer

    Yes

    Default value: Bearer.

    scope

    No

    Authorization scope. Separate multiple values with commas (,).

    Authorization Url

    Yes

    Authentication URL of the application. Obtain the value from the application.

    Obtaintoken Url

    Yes

    URL for obtaining a token. Obtain the value from the application.

    UserInfo Url

    Yes

    URL for obtaining user information. Obtain the value from the application.

    Callback URL

    Yes

    The value is generated by the system and cannot be modified. You can obtain this value when configuring the application.

    Source Attribute

    Yes

    User attribute returned upon successful authentication by the server. This attribute must be the same as that of the application.

    Related User Attribute

    Yes

    OneAccess user attribute that maps the user attribute of the OAuth authentication provider. For example, username.

    No User Associated

    Yes

    Operation that will be performed if a user successfully logs in through OAuth authentication but fails to be associated with a system user.

    Update Existing Attribute

    Yes

    Disabled by default. Determine whether to update the existing user attribute value when a user logs in successfully through the authentication provider and is associated with a system user.

    To map other attributes, such as full name, set No User Associated to Automatically create users, and add the desired mappings. For details, see Table 2.

    Table 2 Mapping parameters

    Parameter

    Description

    User Attribute

    Attribute (such as full name) in OneAccess that maps to the OAuth application.

    Mapping Type

    Mode of user attribute mapping between OneAccess and the OAuth application.

    Authentication Provider Attribute Name

    User attribute in the OAuth application. For details, see the application's configurations.

Enabling OAuth Authentication

  1. Log in to the administrator portal.
  2. In the top navigation pane, choose Resources > Applications. Then select UserCenter in the Pre-integrated Applications section.
  3. On the application information page, click the application icon.
  4. On the application details page, choose Login Settings > Web Applications, enable OAuth authentication, and select the authentication provider added in Adding an OAuth Authentication Provider.

    Figure 4 Enabling OAuth authentication

Logging In to the User Portal Through OAuth Authentication

  1. Go to the user portal login page, select OAuth, enter an account and password of the application, and click Log In.

    Figure 5 Selecting OAuth

  2. After login, go to the administrator portal, choose Users > Organizations and Users, and view the automatically created user.

    • To automatically create a new user if the authorized user is not associated with any system user, set No User Associated to Automatically create users. For details, see Table 2.
    • By default, users automatically created in the preceding scenario belong to the first root organization in OneAccess.
    Figure 6 Viewing users