Search in sources :

Example 1 with IdentityValidator

use of org.eclipse.milo.opcua.sdk.server.identity.IdentityValidator in project milo by eclipse.

the class SessionManager method validateIdentityToken.

private Object validateIdentityToken(Session session, Object tokenObject, SignatureData tokenSignature) throws UaException {
    IdentityValidator identityValidator = server.getConfig().getIdentityValidator();
    UserTokenPolicy tokenPolicy = validatePolicyId(session, tokenObject);
    if (tokenObject instanceof UserIdentityToken) {
        return identityValidator.validateIdentityToken(session, (UserIdentityToken) tokenObject, tokenPolicy, tokenSignature);
    } else {
        throw new UaException(StatusCodes.Bad_IdentityTokenInvalid);
    }
}
Also used : IdentityValidator(org.eclipse.milo.opcua.sdk.server.identity.IdentityValidator) UaException(org.eclipse.milo.opcua.stack.core.UaException) UserIdentityToken(org.eclipse.milo.opcua.stack.core.types.structured.UserIdentityToken) UserTokenPolicy(org.eclipse.milo.opcua.stack.core.types.structured.UserTokenPolicy)

Aggregations

IdentityValidator (org.eclipse.milo.opcua.sdk.server.identity.IdentityValidator)1 UaException (org.eclipse.milo.opcua.stack.core.UaException)1 UserIdentityToken (org.eclipse.milo.opcua.stack.core.types.structured.UserIdentityToken)1 UserTokenPolicy (org.eclipse.milo.opcua.stack.core.types.structured.UserTokenPolicy)1