9.6.6 StartRequestToken

The StartRequestToken Method is used to initiate a new request for an AccessToken.

The PolicyId provided shall identify one of the UserTokenPolicies for the AuthorizationService Object.

The contents of the RequestorData and ServiceData depend on the UserTokenType and the SecurityPolicy. Table 149 specifies the contents for different combinations of UserTokenType and SecurityPolicy.

Table 149 – StartRequestToken Argument Contents
UserTokenTypeRequestorDataServiceData

UserName or IssuedToken

SecurityPolicy: None

Not UsedNot Used

UserName or IssuedToken

SecurityPolicy: RSA

Not UsedA Certificate containing the PublicKey used to build the RsaEncryptedSecret defined in OPC 10000-4.

UserName or IssuedToken

SecurityPolicy: ECC or RSA_DH.

Not UsedAn EphemeralKey used to build the EccEncryptedSecret defined in OPC 10000-4.
CertificateA cryptographically random value generated by the requestor.A cryptographically random value generated by the service.

The AuthorizationService cleans up unused requestIds. Client should call FinishRequestToken immediately after this Method returns. The RequestId is only accessible via the current Session and resources are freed when the Session is closed.

This Method shall be called from an encrypted SecureChannel and from a Client that has access to the AccessTokenRequestor Privilege (see 9.2).

Signature

StartRequestToken(
	[in]  String ResourceId
	[in]  String PolicyId
	[in]  ByteString RequestorData
	[out] ByteString ServiceData
	[out] Guid RequestId
);
Argument Description
ResourceId

The identifier for the Resource that the AccessToken is used to access.

This is usually the ApplicationUri for a Server.

Shall be the ResourceId specified in the UserTokenPolicy. This is usually the Server ApplicationUri.

PolicyIdThe PolicyId from an element in the UserTokenPolicies array.
RequestorDataA value with contents described in Table 149.
ServiceDataA value with contents described in Table 149.
RequestIdA unique value for the request that is passed to FinishRequestToken.

Method Result Codes (defined in Call Service)

Result Code Description
Bad_NotFoundThe ResourceId is not known to the Server.
Bad_IdentityTokenInvalidThe PolicyId does not match one of the allowed UserTokenPolicies.
Bad_NonceInvalidThe RequestorData is not valid for the specified UserTokenPolicy.
Bad_UserAccessDeniedThe current user does not have the rights required.
Bad_SecurityModeInsufficientThe SecureChannel is not encrypted.

Table 150 specifies the AddressSpace representation for the StartRequestToken Method.

Table 150 – StartRequestToken Method AddressSpace Definition
Attribute Value
BrowseName2:StartRequestToken
References NodeClass BrowseName DataType TypeDefinition ModellingRule
0:HasPropertyVariable0:InputArguments0:Argument[] 0:PropertyTypeMandatory
0:HasPropertyVariable0:OutputArguments0:Argument[] 0:PropertyTypeMandatory