Authentication responses
How to subscribe and process authentication responses


Users can respond to authentication requests by accepting or rejecting them. On the other hand, you won’t receive asynchronous notifications for requests which have timed out.

You can subscribe to authentication responses with this snippet

@client.authentication.subscribe do |auth_res|
    puts resp.status
client.MessagingService().Subscribe("identities.authenticate.req", func(m *messaging.Message)) {
    // manage the response
client.messaging().subscribe("identities.authenticate.req", (res: any): any => {
    // manage the response

Processing the response

if resp.accepted?
    p "accepted"
elsif resp.rejected?
    p "rejected"
elsif resp.unauthorized?
    p "unauthorized"
elsif resp.errored?
    p "errored"
    p "unkonwn status"

// Or simply access the status string p resp.status

// Go SDK will return an error for unsuccessful
// responses
err = authService.Request("1112223334")
if err != nil {
    log.Fatal("auth returned with: ", err)

log.Println("authentication succeeded")

try {
let res = await client.authentication().request("1112223334")
if(res.isAccepted() == true) {`${res.selfID} is now authenticated 🤘`)
} else if(res.accepted == false) {
    client.logger.warn(`${res.selfID} has rejected your authentication request`)
} else {
} catch (error) {

The interesting field in an authentication response is status. Valid values for status are:


The user has accepted the authentication request, so you can proceed authenticating it on your app.


The user has rejected the authentication request.


You’re unauthorized to interact with this user, let it know it needs to be connected to your app before continuing with an authentication process.


An internal error happened.

Depending on the SDK there are different ways you can deal with different status, see some examples below