We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.

Only Essential Cookies
Accept All

AccountAuthParamsHelper

  • Supported devices: phones, tablets, HUAWEI Vision products, and telematics devices
  • Supported operating systems: EMUI 3.0 or later and Android 4.4 or later
Expand

Class Info

public class AccountAuthParamsHelper

Constructs an AccountAuthParams object.

Public Constructor Summary

Expand

Constructor Name

public AccountAuthParamsHelper()

A default constructor.

public AccountAuthParamsHelper(AccountAuthParams params)

Constructs AccountAuthParamsHelper using the existing AccountAuthParams object.

Public Method Summary

Expand

Qualifier and Type

Method Name and Description

AccountAuthParamsHelper

setAuthorizationCode()

Requests a user to authorize an app to obtain the authorization code.

AccountAuthParamsHelper

setScopeList(List<Scope> scopeList)

Adds a specified Scope to authorization parameters to request a user to authorize an app to obtain the user information specified by the scope.

AccountAuthParamsHelper

setEmail()

Requests a user to authorize an app to obtain the email address.

AccountAuthParamsHelper

setId()

Requests a user to authorize an app to obtain the UnionID and OpenID.

AccountAuthParamsHelper

setIdToken()

Requests a user to authorize an app to obtain the ID token.

AccountAuthParamsHelper

setProfile()

Requests a user to authorize an app to obtain the account information, such as the nickname and profile picture.

AccountAuthParamsHelper

setCarrierId()

Requests a user to authorize an app to obtain the carrier ID.

AccountAuthParamsHelper

setIdTokenSignAlg(int idTokenSignAlg)

Specifies the signature algorithm type for the ID token. The default algorithm is RS256. If your app supports the PS256 algorithm, you can use the idTokenSignAlg parameter to specify this algorithm. For details, please refer to Cryptographic Algorithms for Digital Signatures and MACs.

AccountAuthParams

createParams()

Constructs AccountAuthParams using the existing AccountAuthParamsHelper object.

Public Constructors

AccountAuthParamsHelper()

Expand

Constructor

public AccountAuthParamsHelper()

A default constructor.

AccountAuthParamsHelper(AccountAuthParams params)

Expand

Constructor

public AccountAuthParamsHelper(AccountAuthParams params)

Constructs AccountAuthParamsHelper using the existing AccountAuthParams object.

Parameters

Expand

Name

Description

params

Existing AccountAuthParams object.

Public Methods

setAuthorizationCode

Expand

Method

public AccountAuthParamsHelper setAuthorizationCode()

Requests a user to authorize an app to obtain the authorization code. If setAuthorizationCode is used, you do not need to call setIdToken(String clientId). When your app server uses the authorization code to obtain tokens from the Huawei OAuth server, the ID token is contained in the returned result.

Returns

Expand

Type

Description

AccountAuthParamsHelper

AccountAuthParamsHelper object.

setScopeList

Expand

Method

public AccountAuthParamsHelper setScopeList(List<Scope> scopeList)

Adds a specified Scope to authorization parameters to request a user to authorize an app to obtain the user information specified by the scope.

Parameters

Expand

Name

Description

scopeList

Scope list.

Returns

Expand

Type

Description

AccountAuthParamsHelper

AccountAuthParamsHelper object.

setEmail

Expand

Method

public AccountAuthParamsHelper setEmail()

Requests a user to authorize an app to obtain the email address.

Returns

Expand

Type

Description

AccountAuthParamsHelper

AccountAuthParamsHelper object.

setId

Expand

Method

public AccountAuthParamsHelper setId()

Requests a user to authorize an app to obtain the UnionID and OpenID.

Returns

Expand

Type

Description

AccountAuthParamsHelper

AccountAuthParamsHelper object.

setIdToken

Expand

Method

public AccountAuthParamsHelper setIdToken()

Requests a user to authorize an app to obtain the ID token.

Returns

Expand

Type

Description

AccountAuthParamsHelper

AccountAuthParamsHelper object.

setProfile

Expand

Method

public AccountAuthParamsHelper setProfile()

Requests a user to authorize an app to obtain the account information, such as the nickname and profile picture.

Returns

Expand

Type

Description

AccountAuthParamsHelper

AccountAuthParamsHelper object.

setCarrierId

Expand

Method

public AccountAuthParamsHelper setCarrierId()

Requests a user to authorize an app to obtain the carrier ID.

Returns

Expand

Type

Description

AccountAuthParamsHelper

AccountAuthParamsHelper object.

setIdTokenSignAlg

Expand

Method

public AccountAuthParamsHelper setIdTokenSignAlg(int idTokenSignAlg)

Specifies the signature algorithm type for the ID token. The default algorithm is RS256. If your app supports the PS256 algorithm, you can use the idTokenSignAlg parameter to specify this algorithm. For details, please refer to Cryptographic Algorithms for Digital Signatures and MACs.

Parameters

Expand

Name

Description

idTokenSignAlg

Signature algorithm type.

  • 1: PS256
  • 2 (default): RS256

Returns

Expand

Type

Description

AccountAuthParamsHelper

AccountAuthParamsHelper object.

createParams

Expand

Method

public AccountAuthParams createParams()

Constructs AccountAuthParams using the existing AccountAuthParamsHelper object.

Returns

Expand

Type

Description

AccountAuthParams

AccountAuthParams object.

Search
Enter a keyword.