Package com.unboundid.ldap.sdk
Class OAUTHBEARERBindResult
- java.lang.Object
-
- com.unboundid.ldap.sdk.LDAPResult
-
- com.unboundid.ldap.sdk.BindResult
-
- com.unboundid.ldap.sdk.OAUTHBEARERBindResult
-
- All Implemented Interfaces:
LDAPResponse
,java.io.Serializable
@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class OAUTHBEARERBindResult extends BindResult
This class provides a bind result that can provide access to the details of a failed OAUTHBEARER SASL bind attempt.- See Also:
OAUTHBEARERBindRequest
, Serialized Form
-
-
Field Summary
-
Fields inherited from interface com.unboundid.ldap.protocol.LDAPResponse
NO_CONTROLS
-
-
Constructor Summary
Constructors Constructor Description OAUTHBEARERBindResult(BindResult bindResult)
Creates a new OAUTHBEARER bind result from the provided single bind result.OAUTHBEARERBindResult(BindResult initialBindResult, BindResult finalBindResult)
Creates a new OAUTHBEARER bind result from the provided pair of results, which correspond to the initial and final (if any) phases of bind processing.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAuthorizationErrorCode()
Retrieves the authorization error code obtained from the failure details object, if available.JSONObject
getFailureDetailsObject()
Retrieves a JSON object with additional information about a failed authentication attempt, if any.BindResult
getFinalBindResult()
Retrieves the result obtained from the final bind attempt in the OAUTHBEARER authentication process, if any.BindResult
getInitialBindResult()
Retrieves the result obtained from the initial bind attempt in the OAUTHBEARER authentication process.java.lang.String
getOpenIDConfigurationURL()
Retrieves the OpenID configuration URL obtained from the failure details object, if available.java.util.Set<java.lang.String>
getScopes()
Retrieves the set of scopes included in the failure details object, if available.void
toString(java.lang.StringBuilder buffer)
Appends a string representation of this LDAP result to the provided buffer.-
Methods inherited from class com.unboundid.ldap.sdk.BindResult
getServerSASLCredentials
-
Methods inherited from class com.unboundid.ldap.sdk.LDAPResult
getDiagnosticMessage, getMatchedDN, getMessageID, getOperationType, getReferralURLs, getResponseControl, getResponseControls, getResultCode, getResultString, hasResponseControl, hasResponseControl, toString
-
-
-
-
Constructor Detail
-
OAUTHBEARERBindResult
public OAUTHBEARERBindResult(@NotNull BindResult bindResult)
Creates a new OAUTHBEARER bind result from the provided single bind result. The provided result is not expected to contain server SASL credentials, but it will attempt to decode any credentials included in the provided result.- Parameters:
bindResult
- The bind result to use to create this OAUTHBEARER bind result. It must not benull
.
-
OAUTHBEARERBindResult
public OAUTHBEARERBindResult(@NotNull BindResult initialBindResult, @Nullable BindResult finalBindResult)
Creates a new OAUTHBEARER bind result from the provided pair of results, which correspond to the initial and final (if any) phases of bind processing.- Parameters:
initialBindResult
- The result obtained in response to the initial OAUTHBEARER bind request. It must not benull
.finalBindResult
- The result obtained in response to the final OAUTHBEARER bind request, if any. It may benull
if the bind consisted of only a single request.
-
-
Method Detail
-
getInitialBindResult
@NotNull public BindResult getInitialBindResult()
Retrieves the result obtained from the initial bind attempt in the OAUTHBEARER authentication process. For a successful authentication, there should only be a single bind. For a failed authentication attempt, there may be either one or two binds, based on whether credentials were included in the initial bind result.- Returns:
- The result obtained from the initial bind attempt in the OAUTHBEARER authentication process.
-
getFinalBindResult
@Nullable public BindResult getFinalBindResult()
Retrieves the result obtained from the final bind attempt in the OAUTHBEARER authentication process, if any. This should always benull
for a successful bind, and it may or may not benull
for a failed attempt, based on whether credentials were included in the initial bind result.- Returns:
- The result obtained for the final bind attempt in the
OAUTHBEARER authentication process, or
null
if the authentication process only included a single bind.
-
getFailureDetailsObject
@Nullable public JSONObject getFailureDetailsObject()
Retrieves a JSON object with additional information about a failed authentication attempt, if any.- Returns:
- A JSON object with additional information about a failed
authentication attempt, or
null
this is not available.
-
getAuthorizationErrorCode
@Nullable public java.lang.String getAuthorizationErrorCode()
Retrieves the authorization error code obtained from the failure details object, if available.- Returns:
- The authorization error code obtained from the failure details
object, or
null
if no failure details object was provided or if it did not include an authorization error code.
-
getScopes
@NotNull public java.util.Set<java.lang.String> getScopes()
Retrieves the set of scopes included in the failure details object, if available.- Returns:
- The set of scopes included in teh failure details object, or an empty set if no failure details object was provided or if it did not include any scopes.
-
getOpenIDConfigurationURL
@Nullable public java.lang.String getOpenIDConfigurationURL()
Retrieves the OpenID configuration URL obtained from the failure details object, if available.- Returns:
- The OpenID configuration URL obtained from the failure details
object, or
null
if no failure details object was provided or if it did not include an OpenID configuration URL.
-
toString
public void toString(@NotNull java.lang.StringBuilder buffer)
Appends a string representation of this LDAP result to the provided buffer.- Specified by:
toString
in interfaceLDAPResponse
- Overrides:
toString
in classBindResult
- Parameters:
buffer
- The buffer to which to append a string representation of this LDAP result.
-
-