9.6 Information Model for Requesting AccessTokens
9.6.1 Overview
The information model for AuthorizationServices which allow Clients to request AccessTokens from a Server is shown in Figure 33.

9.6.2 AuthorizationServicesFolderType
This ObjectType represents a folder that contains AuthorizationService Objects which may be accessed via the Server. It is defined in Table 145.
| Attribute | Value | |||
| BrowseName | 2:AuthorizationServicesFolderType | |||
| IsAbstract | False | |||
| References | NodeClass | BrowseName | TypeDefinition | Modelling Rule |
|---|---|---|---|---|
| Subtype of the FolderType defined in OPC 10000-5. | ||||
| 0:Organizes | Object | 2:<ServiceName> | 2:AuthorizationServiceType | OptionalPlaceholder |
| Conformance Units | ||||
|---|---|---|---|---|
| GDS Authorization Service Server |
9.6.3 AuthorizationServices
This Object is an instance of AuthorizationServicesFolderType. It contains the AuthorizationService Objects which may be accessed via the GDS. It is the target of an Organizes reference from the Objects Folder defined in OPC 10000-5. It is defined in Table 146.
| Attribute | Value | |||
| BrowseName | 2:AuthorizationServices | |||
| TypeDefinition | 2:AuthorizationServicesFolderType defined in 9.6.2. | |||
| References | NodeClass | BrowseName | TypeDefinition | Modelling Rule |
|---|---|---|---|---|
| Conformance Units | ||||
|---|---|---|---|---|
| GDS Authorization Service Server |
9.6.4 AuthorizationServiceType
This ObjectType is the TypeDefinition for an Object that allows access to an AuthorizationService. It is defined in Table 147.
| Attribute | Value | ||||
| BrowseName | 2:AuthorizationServiceType | ||||
| IsAbstract | False | ||||
| References | NodeClass | BrowseName | DataType | TypeDefinition | Modelling Rule |
|---|---|---|---|---|---|
| Subtype of the BaseObjectType defined in OPC 10000-5. | |||||
| 0:HasProperty | Variable | 2:ServiceUri | 0:String | 0:PropertyType | Mandatory |
| 0:HasProperty | Variable | 2:ServiceCertificate | 0:ByteString | 0:PropertyType | Mandatory |
| 0:HasProperty | Variable | 2:UserTokenPolicies | 0:UserTokenPolicy [] | 0:PropertyType | Optional |
| 0:HasProperty | Variable | 2:SupportedRoles | 0:String[] | 0:PropertyType | Optional |
| 0:HasComponent | Method | 2:RequestAccessToken | Defined in 9.6.5. | Optional | |
| 0:HasComponent | Method | 2:StartRequestToken | Defined in 9.6.6. | Optional | |
| 0:HasComponent | Method | 2:FinishRequestToken | Defined in 9.6.7. | Optional | |
| 0:HasComponent | Method | 2:RefreshToken | Defined in 9.6.8. | Optional | |
| 0:HasComponent | Method | 2:GetServiceDescription | Defined in 9.6.9. | Mandatory | |
| 0:GeneratesEvent | ObjectType | 2:AccessTokenRequestedAuditEventType | Defined in 9.6.10. | ||
| 0:GeneratesEvent | ObjectType | 2:AccessTokenIssuedAuditEventType | Defined in 9.6.11. | ||
| Conformance Units | |||||
|---|---|---|---|---|---|
| GDS Authorization Service Server |
The ServiceUri Property contains a globally unique identifier that allows a Client to correlate an instance of AuthorizationServiceType with instances of AuthorizationServiceConfigurationType (see 9.7.4).
The ServiceCertificate Property contains the Certificate required to check any Signature that is included with the AccessTokens. The ServiceCertificate may be a complete chain (see OPC 10000-6 for information on encoding chains). CRLs are not used by the target Server when verifying AccessTokens. It is the responsibility of the AuthorizationService to verify that the ServiceCertificate is not revoked or otherwise invalid before returning any AccessToken to Clients. When a CertificateManager pushes the configuration to a target Server, the CertificateManager is responsible for verifying the ServiceCertificate and automatically updating the target Server if the ServiceCertificate is revoked.
The UserTokenPolicies Property specifies the UserIdentityTokens which are accepted by the RequestAccessToken or FinishRequestToken Methods.
The SupportedRoles Property specifies the system-wide Roles which may be included in an AccessToken. Each target Server uses mapping rules (see OPC 10000-18) to specify the relationship between the system-wide Roles and Roles known to the target Server.
The GetServiceDescription Method is used to read the metadata used to request AccessTokens.
The RequestAccessToken Method is used to request an AccessToken from the AuthorizationService.
The StartRequestToken Method initiates a request for an AccessToken from the AuthorizationService.
The FinishRequestToken Method completes a request for an AccessToken from the AuthorizationService.
The RefreshToken Method is used to request an updated AccessToken.
9.6.5 RequestAccessToken (Deprecated)
It is deprecated because it can only be used with unencrypted UserName IdentityTokens. Use StartRequestToken instead.
RequestAccessToken is used to request an AccessToken from an AuthorizationService. The scenarios where this Method is used are described fully in 9.3, 9.4 and 9.5.
The PolicyId and UserTokenType of the IdentityToken shall match one of the elements of the UserTokenPolicies Property. If the IdentityToken is not provided the Server should use the ApplicationInstanceCertificate and/or the UserIdentityToken provided for the Session (or the request if using a Session-less Method Call) to determine privileges.
If the associated UserTokenPolicy provides a SecurityPolicyUri, then the IdentityToken is encrypted and digitally signed using the format defined for UserIdentityToken secrets in OPC 10000-4.
This Method shall be called from an encrypted SecureChannel and from a Client that has access to the AccessTokenRequestor Privilege (see 9.2).
Signature
RequestAccessToken (
[in] UserIdentityToken IdentityToken
[in] String ResourceId
[out] String AccessToken
);| Argument | Description |
| IdentityToken | The identity used to authorize the AccessToken request. |
| ResourceId | The identifier for the Resource that the AccessToken is used to access. This is usually the ApplicationUri for a Server. The recommended source of this value is the ResourceId in the UserTokenPolicy provided by the Server that the caller wants to connect to (see OPC 10000-6). |
| AccessToken | The AccessToken granted to the application. |
Method Result Codes (defined in Call Service)
| Result Code | Description |
| Bad_IdentityTokenInvalid | The IdentityToken does not match one of the allowed UserTokenPolicies. |
| Bad_IdentityTokenRejected | The IdentityToken was rejected. |
| Bad_NotFound | The ResourceId is not known to the Server. |
| Bad_UserAccessDenied | The current user does not have the rights required. |
| Bad_SecurityModeInsufficient | The SecureChannel is not encrypted. |
Table 148 specifies the AddressSpace representation for the RequestAccessToken Method.
| Attribute | Value | ||||
| BrowseName | 2:RequestAccessToken | ||||
| References | NodeClass | BrowseName | DataType | TypeDefinition | ModellingRule |
|---|---|---|---|---|---|
| 0:HasProperty | Variable | 0:InputArguments | 0:Argument[] | 0:PropertyType | Mandatory |
| 0:HasProperty | Variable | 0:OutputArguments | 0:Argument[] | 0:PropertyType | Mandatory |
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.
| UserTokenType | RequestorData | ServiceData |
|---|---|---|
UserName or IssuedToken SecurityPolicy: None | Not Used | Not Used |
UserName or IssuedToken SecurityPolicy: RSA | Not Used | A Certificate containing the PublicKey used to build the RsaEncryptedSecret defined in OPC 10000-4. |
UserName or IssuedToken SecurityPolicy: ECC or RSA_DH. | Not Used | An EphemeralKey used to build the EccEncryptedSecret defined in OPC 10000-4. |
| Certificate | A 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. |
| PolicyId | The PolicyId from an element in the UserTokenPolicies array. |
| RequestorData | A value with contents described in Table 149. |
| ServiceData | A value with contents described in Table 149. |
| RequestId | A unique value for the request that is passed to FinishRequestToken. |
Method Result Codes (defined in Call Service)
| Result Code | Description |
| Bad_NotFound | The ResourceId is not known to the Server. |
| Bad_IdentityTokenInvalid | The PolicyId does not match one of the allowed UserTokenPolicies. |
| Bad_NonceInvalid | The RequestorData is not valid for the specified UserTokenPolicy. |
| Bad_UserAccessDenied | The current user does not have the rights required. |
| Bad_SecurityModeInsufficient | The SecureChannel is not encrypted. |
Table 150 specifies the AddressSpace representation for the StartRequestToken Method.
| Attribute | Value | ||||
| BrowseName | 2:StartRequestToken | ||||
| References | NodeClass | BrowseName | DataType | TypeDefinition | ModellingRule |
|---|---|---|---|---|---|
| 0:HasProperty | Variable | 0:InputArguments | 0:Argument[] | 0:PropertyType | Mandatory |
| 0:HasProperty | Variable | 0:OutputArguments | 0:Argument[] | 0:PropertyType | Mandatory |
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 |
| RequestId | The identifier returned by StartRequestToken. |
| RequestedRoles | The list of Roles from the SupportedRoles Property that the requestor wants access to. If none are specified then all available Roles are granted. |
| UserIdentityToken | The identity used to authorize the AccessToken request. |
| UserTokenSignature | The Signature used to prove possession of a Certificate provided with an X509IdentityToken AccessToken. Otherwise, the parameter is null. |
| AccessToken | The AccessToken granted to the application. |
| AccessTokenExpiryTime | When the AccessToken expires. If the ExpiryTime is not known the AuthorizationServer shall provide a suitable non-null value. |
| RefreshToken | A token that can be cached and used to request a new AccessToken. |
| RefreshTokenExpiryTime | When 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_NotFound | The RequestId is invalid or has expired. |
| Bad_IdentityTokenInvalid | The IdentityToken does not match one of the allowed UserTokenPolicies. |
| Bad_IdentityTokenRejected | The IdentityToken was rejected. |
| Bad_UserAccessDenied | The current user does not have the rights required. |
| Bad_SecurityModeInsufficient | The SecureChannel is not encrypted. |
Table 148 specifies the AddressSpace representation for the FinishRequestToken Method.
| Attribute | Value | ||||
| BrowseName | 2:FinishRequestToken | ||||
| References | NodeClass | BrowseName | DataType | TypeDefinition | ModellingRule |
|---|---|---|---|---|---|
| 0:HasProperty | Variable | 0:InputArguments | 0:Argument[] | 0:PropertyType | Mandatory |
| 0:HasProperty | Variable | 0:OutputArguments | 0:Argument[] | 0:PropertyType | Mandatory |
9.6.8 RefreshToken
The RefreshToken Method is used to request an AccessToken from an AuthorizationService using a cached RefreshToken.
The CurrentRefreshToken shall only be accepted if the ClientCertificate used to create the SecureChannel is the same as the ClientCertificate used when the FinishRequestToken Method returned the original RefeshToken.
This Method shall be called from an encrypted SecureChannel and from a Client that has access to the AccessTokenRequestor Privilege (see 9.2).
Signature
RefreshToken (
[in] String ResourceId
[in] String CurrentRefreshToken
[out] String AccessToken
[out] DateTime AccessTokenExpiryTime
[out] String NewRefreshToken
[out] DateTime NewRefreshTokenExpiryTime
);| Argument | Description |
| ResourceId | The identifier for the Resource that the AccessToken is used to access. This is usually the ApplicationUri for a Server. |
| CurrentRefreshToken | The RefreshToken previously returned by the AuthorizationService. |
| AccessToken | The AccessToken granted to the application. |
| AccessTokenExpiryTime | When the AccessToken expires. If the ExpiryTime is not known the AuthorizationServer shall provide a suitable non-null value. |
| NewRefreshToken | A token that can be cached and used to request a new AccessToken. It replaces the RefreshToken that was provided in the Request. If null or empty the current RefreshToken can be used again. |
| NewRefreshTokenExpiryTime | When 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_IdentityTokenRejected | The RefreshToken was rejected. |
| Bad_NotFound | The ResourceId is not known to the Server. |
| Bad_UserAccessDenied | The current user does not have the rights required. |
| Bad_SecurityModeInsufficient | The SecureChannel is not encrypted. |
Table 148 specifies the AddressSpace representation for the RequestAccessToken Method.
| Attribute | Value | ||||
| BrowseName | 2:RefreshToken | ||||
| References | NodeClass | BrowseName | DataType | TypeDefinition | ModellingRule |
|---|---|---|---|---|---|
| 0:HasProperty | Variable | 0:InputArguments | 0:Argument[] | 0:PropertyType | Mandatory |
| 0:HasProperty | Variable | 0:OutputArguments | 0:Argument[] | 0:PropertyType | Mandatory |
9.6.9 GetServiceDescription
The GetServiceDescription Method is used to read the metadata needed to request AccessTokens from the AuthorizationService.
Signature
GetServiceDescription (
[out] String ServiceUri
[out] ByteString ServiceCertificate
[out] UserTokenPolicy[] UserTokenPolicies
);| Argument | Description |
| ServiceUri | A globally unique identifier for the AuthorizationService. |
| ServiceCertificate | The complete chain of Certificates used to to validate the AccessTokens provided by the AuthorizationService. |
| UserTokenPolicies | The UserIdentityTokens accepted by the AuthorizationService. |
Method Result Codes (defined in Call Service)
| Result Code | Description |
| Bad_UserAccessDenied | The current user does not have the rights required. |
Table 153 specifies the AddressSpace representation for the GetServiceDescription Method.
| Attribute | Value | ||||
| BrowseName | 2:GetServiceDescription | ||||
| References | NodeClass | BrowseName | DataType | TypeDefinition | ModellingRule |
|---|---|---|---|---|---|
| 0:HasProperty | Variable | 0:OutputArguments | 0:Argument[] | 0:PropertyType | Mandatory |
9.6.10 AccessTokenRequestedAuditEventType
This event is raised when a AccessToken is requested as a result of a FinishRequestToken Method being called.
This Event and its subtypes are security related and Servers shall only report them to users authorized to view security related audit events.
Its representation in the AddressSpace is formally defined in Table 155.
| References | NodeClass | BrowseName | DataType | TypeDefinition | Modelling Rule |
|---|---|---|---|---|---|
| Attribute | Value | ||||
| BrowseName | 2:AccessTokenRequestedAuditEventType | ||||
| IsAbstract | True | ||||
| Subtype of the 0:AuditUpdateMethodEventType defined in OPC 10000-5. | |||||
| Conformance Units | |||||
|---|---|---|---|---|---|
| GDS Authorization Service Server |
This EventType inherits all Properties of the AuditUpdateMethodEventType. Their semantic is defined in OPC 10000-5.
9.6.11 AccessTokenIssuedAuditEventType
This event is raised when a AccessToken is issued.
This is the result of a RequestAccessToken Method completing.
This Event and its subtypes are security related and Servers shall only report them to users authorized to view security related audit events.
Its representation in the AddressSpace is formally defined in Table 155.
| References | NodeClass | BrowseName | DataType | TypeDefinition | Modelling Rule |
|---|---|---|---|---|---|
| Attribute | Value | ||||
| BrowseName | 2:AccessTokenIssuedAuditEventType | ||||
| IsAbstract | True | ||||
| Subtype of the 0:AuditUpdateMethodEventType defined in OPC 10000-5. | |||||
| Conformance Units | |||||
|---|---|---|---|---|---|
| GDS Authorization Service Server |
This EventType inherits all Properties of the AuditUpdateMethodEventType. Their semantic is defined in OPC 10000-5.