9.6.7 FinishRequestToken

The FinishRequestToken Method is used to complete a request for an AccessToken from an AuthorizationService. It is called after calling StartRequestToken defined in 9.6.6.

The RequestedRoles are used to restrict the permissions that are granted to the AccessToken. If RequestedRoles are not provided the AuthorizationService includes all Roles available to the UserIdentityToken provided in the call. The SupportedRoles Property provides all Roles supported by the AuthorizationService.

The UserIdentityToken contains the credentials that the AccessToken will represent.

The UserTokenSignature is computed using the channel bound signatures defined in OPC 10000-4 where the ServiceData replaces the ServerNonce and the RequestorData replaces the ClientNonce.

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

Signature

FinishRequestToken (
  [in]  Guid RequestId
	[in]  String[] RequestedRoles
	[in]  UserIdentityToken UserIdentityToken
	[in]  SignatureData UserTokenSignature
	[out] String AccessToken
	[out] DateTime AccessTokenExpiryTime
	[out] String RefreshToken
	[out] DateTime RefreshTokenExpiryTime

);
Argument Description
RequestIdThe identifier returned by StartRequestToken.
RequestedRolesThe list of Roles from the SupportedRoles Property that the requestor wants access to. If none are specified then all available Roles are granted.
UserIdentityTokenThe identity used to authorize the AccessToken request.
UserTokenSignatureThe Signature used to prove possession of a Certificate provided with an X509IdentityToken AccessToken. Otherwise, the parameter is null.
AccessTokenThe AccessToken granted to the application.
AccessTokenExpiryTimeWhen the AccessToken expires. If the ExpiryTime is not known the AuthorizationServer shall provide a suitable non-null value.
RefreshTokenA token that can be cached and used to request a new AccessToken.
RefreshTokenExpiryTimeWhen the RefreshToken expires. If the ExpiryTime is not known the AuthorizationServer shall provide a suitable non-null value.

Method Result Codes (defined in Call Service)

Result Code Description
Bad_NotFoundThe RequestId is invalid or has expired.
Bad_IdentityTokenInvalidThe IdentityToken does not match one of the allowed UserTokenPolicies.
Bad_IdentityTokenRejectedThe IdentityToken was rejected.
Bad_UserAccessDeniedThe current user does not have the rights required.
Bad_SecurityModeInsufficientThe SecureChannel is not encrypted.

Table 148 specifies the AddressSpace representation for the FinishRequestToken Method.

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