Initiate Challenge
API schema
const request = {
verificationMethod: "SMS",
action: "signInWithSms",
phoneNumber: "+64270000000",
};
const response = await authsignal.challenge(request);
const challengeId = response.challengeId;
var request = new ChallengeRequest(
VerificationMethod: VerificationMethod.SMS,
Action: "signInWithSms",
PhoneNumber: "+64270000000"
);
var response = await authsignal.challenge(request);
var challengeId = response.ChallengeId;
ChallengeRequest request = new ChallengeRequest();
request.verificationMethod = VerificationMethodType.SMS;
request.action = "signInWithSms";
request.phoneNumber = "+64270000000";
ChallengeResponse response = authsignal.challenge(request).get();
String challengeId = response.challengeId;
response = Authsignal.challenge(
verification_method: "SMS",
action: "signInWithSms",
phone_number: "+64270000000",
)
challenge_id = response[:challenge_id]
response, err := client.Challenge(
ChallengeRequest{
VerificationMethod: "SMS",
Action: "signInWithSms",
PhoneNumber: "+64270000000",
},
)
challengeId := response.challengeId
Verify Challenge
API schema
const request = {
challengeId: "3a991a14-690c-492b-a5e5-02b9056a4b7d",
verificationCode: "123456",
};
const response = await authsignal.verify(request);
const isVerified = response.isVerified;
var request = new VerifyRequest(
ChallengeId: "3a991a14-690c-492b-a5e5-02b9056a4b7d",
VerificationCode: "123456"
);
var response = await authsignal.Verify(request);
var isVerified = response.IsVerified;
VerifyRequest request = new VerifyRequest();
request.challengeId = "3a991a14-690c-492b-a5e5-02b9056a4b7d";
request.verificationCode = "123456";
VerifyResponse response = authsignal.verify(request).get();
boolean isVerified = response.isVerified;
response = Authsignal.verify(
challenge_id: "3a991a14-690c-492b-a5e5-02b9056a4b7d",
verification_code: "123456",
)
is_verified = response[:is_verified]
response, err := client.Verify(
VerifyRequest{
ChallengeId: "3a991a14-690c-492b-a5e5-02b9056a4b7d",
VerificationCode: "123456",
},
)
isVerified := response.IsVerified
Claim Challenge
API schema
const request = {
challengeId: "3a991a14-690c-492b-a5e5-02b9056a4b7d",
userId: "dc58c6dc-a1fd-4a4f-8e2f-846636dd4833",
};
const response = await authsignal.claimChallenge(request);
var request = new ClaimChallengeRequest(
ChallengeId: "3a991a14-690c-492b-a5e5-02b9056a4b7d",
UserId: "dc58c6dc-a1fd-4a4f-8e2f-846636dd4833"
);
var response = await authsignal.ClaimChallenge(request);
ClaimChallengeRequest request = new ClaimChallengeRequest();
request.challengeId = "3a991a14-690c-492b-a5e5-02b9056a4b7d";
request.userId = "dc58c6dc-a1fd-4a4f-8e2f-846636dd4833";
ClaimChallengeResponse response = authsignal.claimChallenge(request).get();
response = Authsignal.claim_challenge(
challenge_id: "3a991a14-690c-492b-a5e5-02b9056a4b7d",
user_id: "dc58c6dc-a1fd-4a4f-8e2f-846636dd4833",
)
response, err := client.ClaimChallenge(
ClaimChallengeRequest{
ChallengeId: "3a991a14-690c-492b-a5e5-02b9056a4b7d",
UserId: "dc58c6dc-a1fd-4a4f-8e2f-846636dd4833",
},
)
Get Challenge
API schema
const request = {
challengeId: "3a991a14-690c-492b-a5e5-02b9056a4b7d",
};
const response = await authsignal.getChallenge(request);
var request = new GetChallengeRequest(
ChallengeId: "3a991a14-690c-492b-a5e5-02b9056a4b7d"
);
var response = await authsignal.GetChallenge(request);
GetChallengeRequest request = new GetChallengeRequest();
request.challengeId = "3a991a14-690c-492b-a5e5-02b9056a4b7d";
GetChallengeResponse response = authsignal.getChallenge(request).get();
response = Authsignal.get_challenge(
challenge_id: "3a991a14-690c-492b-a5e5-02b9056a4b7d",
)
response, err := client.GetChallenge(
GetChallengeRequest{
ChallengeId: "3a991a14-690c-492b-a5e5-02b9056a4b7d",
},
)
Validate Challenge
API schema
token from the pre-built UI or a Client SDK, pass this token to your server to determine the result.
const request = {
action: "signIn",
token: "eyJhbGciOiJ...",
};
const response = await authsignal.validateChallenge(request);
if (response.state === "CHALLENGE_SUCCEEDED") {
// The user completed the challenge successfully
// Proceed with authenticated action
} else {
// The user did not complete the challenge successfully
}
var request = new ValidateChallengeRequest(
Action: "signIn,
Token: "eyJhbGciOiJ..."
);
var response = await authsignal.ValidateChallenge(request);
if (response.State == UserActionState.CHALLENGE_SUCCEEDED) {
// The user completed the challenge successfully
// Proceed with authenticated action
} else {
// The user did not complete the challenge successfully
}
ValidateChallengeRequest request = new ValidateChallengeRequest();
request.action = "signIn";
request.token = "eyJhbGciOiJ...";
ValidateChallengeResponse response = authsignal.validateChallenge(request).get();
if (response.state == UserActionState.CHALLENGE_SUCCEEDED) {
// The user completed the challenge successfully
// Proceed with authenticated action
} else {
// The user did not complete the challenge successfully
}
response = Authsignal.validate_challenge(
action: "signIn",
token: "eyJhbGciOiJ..."
)
if response[:state] == "CHALLENGE_SUCCEEDED"
# The user completed the challenge successfully
# Proceed with authenticated action
else
# The user did not complete the challenge successfully
end
response = authsignal.validate_challenge(
attributes={
"action": "signIn",
"token": "eyJhbGciOiJ..."
}
)
if response["state"] == "CHALLENGE_SUCCEEDED":
# The user completed the challenge successfully
# Proceed with authenticated action
else:
# The user did not complete the challenge successfully
$response = Authsignal::validateChallenge([
'action' => "signIn",
'token' => "eyJhbGciOiJ...",
]);
if ($response["state"] === "CHALLENGE_SUCCEEDED") {
# The user completed the challenge successfully
# Proceed with authenticated action
} else {
# The user did not complete the challenge successfully
}
response, err := client.ValidateChallenge(
ValidateChallengeRequest{
Action: "signIn",
Token: "eyJhbGciOiJ...",
},
)
if response.State == "CHALLENGE_SUCCEEDED" {
// The user completed the challenge successfully
// Proceed with authenticated action
} else {
// The user did not complete the challenge successfully
}

