目录

AccountAuthParamsHelper

Class Info

public class AccountAuthParamsHelper

Constructs an AccountAuthParams object.

Public Constructor Summary

Constructor Name

public AccountAuthParamsHelper()

A default constructor.

public AccountAuthParamsHelper(AccountAuthParams params)

Constructs AccountAuthParamsHelper using the existing AccountAuthParams object.

Public Method Summary

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

[h2]AccountAuthParamsHelper()

Constructor

public AccountAuthParamsHelper()

A default constructor.

[h2]AccountAuthParamsHelper(AccountAuthParams params)

Constructor

public AccountAuthParamsHelper(AccountAuthParams params)

Constructs AccountAuthParamsHelper using the existing AccountAuthParams object.

Parameters

Name

Description

params

Existing AccountAuthParams object.

Public Methods

[h2]setAuthorizationCode

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

Type

Description

AccountAuthParamsHelper

AccountAuthParamsHelper object.

[h2]setScopeList

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

Name

Description

scopeList

Scope list.

Returns

Type

Description

AccountAuthParamsHelper

AccountAuthParamsHelper object.

[h2]setEmail

Method

public AccountAuthParamsHelper setEmail()

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

Returns

Type

Description

AccountAuthParamsHelper

AccountAuthParamsHelper object.

[h2]setId

Method

public AccountAuthParamsHelper setId()

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

Returns

Type

Description

AccountAuthParamsHelper

AccountAuthParamsHelper object.

[h2]setIdToken

Method

public AccountAuthParamsHelper setIdToken()

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

Returns

Type

Description

AccountAuthParamsHelper

AccountAuthParamsHelper object.

[h2]setProfile

Method

public AccountAuthParamsHelper setProfile()

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

Returns

Type

Description

AccountAuthParamsHelper

AccountAuthParamsHelper object.

[h2]setCarrierId

Method

public AccountAuthParamsHelper setCarrierId()

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

Returns

Type

Description

AccountAuthParamsHelper

AccountAuthParamsHelper object.

[h2]setIdTokenSignAlg

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

Name

Description

idTokenSignAlg

Signature algorithm type.

  • 1: PS256
  • 2 (default): RS256

Returns

Type

Description

AccountAuthParamsHelper

AccountAuthParamsHelper object.

[h2]createParams

Method

public AccountAuthParams createParams()

Constructs AccountAuthParams using the existing AccountAuthParamsHelper object.

Returns

Type

Description

AccountAuthParams

AccountAuthParams object.