Skip to main content

auth.finishPasskeyLogin

Complete login with a passkey over an unauthenticated connection, see here » for more info. Must be sent to the user's native DC, as specified by the user_handle (dcId:userId) returned in the passkey assertion, see here » for the full flow.

func (c *Client) AuthFinishPasskeyLogin(ctx context.Context, request *AuthFinishPasskeyLoginRequest) (AuthAuthorizationClass, error)

Calling this method

client.Run(ctx, func(ctx context.Context) error {
api := client.API()

res, err := api.AuthFinishPasskeyLogin(ctx, &tg.AuthFinishPasskeyLoginRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // AuthAuthorizationClass
return nil
})

Parameters

NameTypeRequiredDescription
CredentialInputPasskeyCredentialClassyesPasskey assertion result.
FromDCIDintDC ID used for the initial auth.initPasskeyLogin request; set only if the user's DC is different from the DC used for the initial auth.initPasskeyLogin.
FromAuthKeyIDint64Auth key ID for the connection to from_dc_id (use the permanent auth key ID if PFS is enabled); set only if the user's DC is different from the DC used for the initial auth initPasskeyLogin.

Returns

AuthAuthorizationClass

Possible errors

CodeTypeDescription
500AUTH_RESTARTRestart the authorization process.
400CREDENTIAL_INVALID
500PASSKEY_AUTH_RESTART

References