Class WebAuthnAuthenticationCallback
- java.lang.Object
-
- org.forgerock.android.auth.callback.AbstractCallback
-
- org.forgerock.android.auth.callback.MetadataCallback
-
- org.forgerock.android.auth.callback.WebAuthnAuthenticationCallback
-
- All Implemented Interfaces:
java.io.Serializable,Callback,DerivableCallback,WebAuthnCallback
public class WebAuthnAuthenticationCallback extends MetadataCallback implements WebAuthnCallback
A callback that handle WebAuthnAuthentication Node.When serialized as JSON in an authenticate response, the
MetadataCallback.getValue()object will be the value of a single data output value, so for a value of{ "foo": "bar" }, this would be output as:{@code { "authId": "...", "callbacks": [ // ... { "type": "MetadataCallback", "output": [ { "name": "data", "value": { "_action": "webauthn_authentication", "challenge": "6gckyPcs5bDIstu08mgtl+1Yr2g6N/KRJoCNkGXM2wY=", "allowCredentials": "allowCredentials: [{ \"type\": \"public-key\", \"id\": new Int8Array([1, -91, -21, 122, -16, 124, 2, 23, 116, 47, 7, 38, 115, -67, 30, 80, -91, 56, -50, 106, 85, 55, -126, -119, -110, 124, 117, 61, 29, -103, 115, -37, 6, 91, -45, 58, -34, 67, 21, 14, -72, 81, -119, 15, 70, 13, 48, -114, -57, 8, -67, 2, -20, 18, -62, 106, -76, 66, 6, 13, 23, -48, -58, -78, 105]).buffer }]", "_allowCredentials": [ { "type": "public-key", "id": [ 1, -91, -21, 122, -16, 124, 2, 23, 116, 47, 7, 38, 115, -67, 30, 80, -91, 56, -50, 106, 85, 55, -126, -119, -110, 124, 117, 61, 29, -103, 115, -37, 6, 91, -45, 58, -34, 67, 21, 14, -72, 81, -119, 15, 70, 13, 48, -114, -57, 8, -67, 2, -20, 18, -62, 106, -76, 66, 6, 13, 23, -48, -58, -78, 105 ] } ], "timeout": "60000", "userVerification": "preferred", "relyingPartyId": "rpId: \"humorous-cuddly-carrot.glitch.me\",", "_relyingPartyId": "humorous-cuddly-carrot.glitch.me", "_type": "WebAuthn" } } ] } ] }- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.forgerock.android.auth.callback.AbstractCallback
_id, content, VALUE
-
-
Constructor Summary
Constructors Constructor Description WebAuthnAuthenticationCallback()WebAuthnAuthenticationCallback(org.json.JSONObject jsonObject, int index)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidauthenticate(androidx.fragment.app.Fragment fragment, Node node, WebAuthnKeySelector selector, FRListener<java.lang.Void> listener)Perform WebAuthn Authenticationvoidauthenticate(Node node, WebAuthnKeySelector selector, FRListener<java.lang.Void> listener)Perform WebAuthn Authentication with the current Activity, the Activity has to be of typeFragmentActivityjava.lang.StringgetType()Return the type of the Callback, the type name should align with the Callback type returned from AMprotected WebAuthnAuthenticationgetWebAuthnAuthentication()static booleaninstanceOf(org.json.JSONObject value)Check if this callback isWebAuthnAuthenticationCallbackType-
Methods inherited from class org.forgerock.android.auth.callback.MetadataCallback
getDerivedCallback, getValue, setAttribute
-
Methods inherited from class org.forgerock.android.auth.callback.AbstractCallback
get_id, getContent, getContentAsJson, getInputValue, getInputValue, getName, setContent, setValue, setValue
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.forgerock.android.auth.callback.WebAuthnCallback
setHiddenCallbackValue
-
-
-
-
Method Detail
-
instanceOf
public static boolean instanceOf(org.json.JSONObject value)
Check if this callback isWebAuthnAuthenticationCallbackType- Parameters:
value- The callback raw data json.- Returns:
- True if this is a
WebAuthnAuthenticationCallbackType, else false
-
getType
public java.lang.String getType()
Description copied from interface:CallbackReturn the type of the Callback, the type name should align with the Callback type returned from AM- Specified by:
getTypein interfaceCallback- Overrides:
getTypein classMetadataCallback
-
authenticate
public void authenticate(@NonNull androidx.fragment.app.Fragment fragment, @NonNull Node node, @Nullable WebAuthnKeySelector selector, FRListener<java.lang.Void> listener)Perform WebAuthn Authentication- Parameters:
fragment- The current Fragment that handle this callback.node- The Node returned from AM.selector- The selector to select which credential key to use. Apply to Username-less only.listener- Listener
-
authenticate
public void authenticate(@NonNull Node node, @Nullable WebAuthnKeySelector selector, FRListener<java.lang.Void> listener)Perform WebAuthn Authentication with the current Activity, the Activity has to be of typeFragmentActivity- Parameters:
node- The Node returned from AMselector- The selector to select which credential key to use. Apply to Username-less only.listener- Listener
-
getWebAuthnAuthentication
protected WebAuthnAuthentication getWebAuthnAuthentication() throws org.json.JSONException
- Throws:
org.json.JSONException
-
-