otpless_auth

Crates.iootpless_auth
lib.rsotpless_auth
version0.1.2
sourcesrc
created_at2023-11-01 10:49:01.074014
updated_at2023-11-01 11:35:00.793986
descriptionto authenticate otpless jwt token for otpless user detail
homepage
repositoryhttps://github.com/otpless-tech/otpless_auth
max_upload_size
id1020847
size10,233
(dev-otpless-tech)

documentation

README

otpless_auth

Installation

Add the following to Cargo.toml:

otpless_auth = "0.1.2"

How to use

Import the get_otpless_user function

extern crate otpless_auth;
use otpless_auth::api::otpless::get_otpless_user;

method signature

pub fn get_otpless_user(jwt_token: &str, client_id: &str) -> Result<OtplessUserDetail, OtplessError>

Method Params:

Params Data type Mandatory Constraints Remarks
jwt_token String true token which you get from OTPLess
client_id String true Your OTPLess Client Id

Return

Return: Object Name: Result<OtplessUserDetail, OtplessError>

OtplessUserDetail Object Fields:

auth_time (Long, required): The time when authentication was completed.
phone_number (String, required): The user's phone number.
country_code (String, required): The country code of user's phone number.
national_phone_number (String, required): The user's phone number without country code.
email (String, required): The user's email address.
name (String, required): The user's full name.

OtplessError Object Fields:

message (String): The message contains error information.
jwt_error (Some): jsonwebtoken encoding and decoding error enum.

Commit count: 0

cargo fmt