public class UsernameProvider extends Object implements IdentityProvider
| Constructor and Description |
|---|
UsernameProvider(String username,
String password)
Construct a
UsernameProvider that does not validate the remote certificate and selects the first
available UserTokenPolicy with UserTokenType.UserName. |
UsernameProvider(String username,
String password,
ClientCertificateValidator certificateValidator)
Construct a
UsernameProvider that validates the remote certificate using certificateValidator
and selects the first available UserTokenPolicy with UserTokenType.UserName. |
UsernameProvider(String username,
String password,
ClientCertificateValidator certificateValidator,
Function<List<org.eclipse.milo.opcua.stack.core.types.structured.UserTokenPolicy>,org.eclipse.milo.opcua.stack.core.types.structured.UserTokenPolicy> policyChooser)
Construct a
UsernameProvider that validates the remote certificate using certificateValidator
and selects ta UserTokenPolicy using policyChooser. |
| Modifier and Type | Method and Description |
|---|---|
SignedIdentityToken |
getIdentityToken(org.eclipse.milo.opcua.stack.core.types.structured.EndpointDescription endpoint,
org.eclipse.milo.opcua.stack.core.types.builtin.ByteString serverNonce)
Return the
UserIdentityToken and SignatureData (if applicable for the token) to use when
activating a session. |
static UsernameProvider |
of(String username,
String password,
ClientCertificateValidator certificateValidator) |
String |
toString() |
public UsernameProvider(String username, String password)
UsernameProvider that does not validate the remote certificate and selects the first
available UserTokenPolicy with UserTokenType.UserName.username - the username to authenticate with.password - the password to authenticate with.public UsernameProvider(String username, String password, ClientCertificateValidator certificateValidator)
UsernameProvider that validates the remote certificate using certificateValidator
and selects the first available UserTokenPolicy with UserTokenType.UserName.username - the username to authenticate with.password - the password to authenticate with.certificateValidator - the ClientCertificateValidator used to validate the remote certificate.public UsernameProvider(String username, String password, ClientCertificateValidator certificateValidator, Function<List<org.eclipse.milo.opcua.stack.core.types.structured.UserTokenPolicy>,org.eclipse.milo.opcua.stack.core.types.structured.UserTokenPolicy> policyChooser)
UsernameProvider that validates the remote certificate using certificateValidator
and selects ta UserTokenPolicy using policyChooser.
Useful if the server might return more than one UserTokenPolicy with UserTokenType.UserName.
username - the username to authenticate with.password - the password to authenticate with.certificateValidator - the ClientCertificateValidator used to validate the remote certificate.policyChooser - a function that selects a UserTokenPolicy to use. The policy list is
guaranteed to be non-null and non-empty.public SignedIdentityToken getIdentityToken(org.eclipse.milo.opcua.stack.core.types.structured.EndpointDescription endpoint, org.eclipse.milo.opcua.stack.core.types.builtin.ByteString serverNonce) throws Exception
IdentityProviderUserIdentityToken and SignatureData (if applicable for the token) to use when
activating a session.getIdentityToken in interface IdentityProviderendpoint - the EndpointDescription being connected to.SignedIdentityToken containing the UserIdentityToken and SignatureData.Exceptionpublic static UsernameProvider of(String username, String password, ClientCertificateValidator certificateValidator)
Copyright © 2021. All rights reserved.