Download the PHP package zsgogo/otpless-auth-sdk without Composer

On this page you can find all versions of the php package zsgogo/otpless-auth-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package otpless-auth-sdk

Merchant Integration Documentation(Backend PHP Auth SDK)


A. OTPLessAuth Dependency

install Below dependency in your project's

you can also get latest version of dependency at https://packagist.org/packages/otpless/otpless-auth-sdk


B. OTPLessAuth class

The OtplessAuth class provides methods to integrate OTPLess authentication into your PHP backend application. This documentation explains the usage of the class and its methods.

Methods:


1. decodeIdToken


This method help to resolve idToken(JWT token) which is issued by OTPLess which return user detail from that token also this method verify that token is valid, token should not expired and issued by only otpless.com

Method Signature:

Method Params:

Params Data type Mandatory Constraints Remarks
idToken String true idToken which is JWT token which you get from OTPLess by exchange code API
clientId String true Your OTPLess Client Id
clientSecret String true Your OTPLess Client Secret

Return

Return: Object Name: UserDetail

2. verify code


This method help to resolve code which is return from OTPLess which will return user detail from that code also this method verify that code is valid, code should not expired and issued by only otpless.com

Method Signature:

Method Params:

Params Data type Mandatory Constraints Remarks
code String true code which you get from OTPLess
clientId String true Your OTPLess Client Id
clientSecret String true Your OTPLess Client Secret

Return

Return: Object Name: UserDetail

3. Verify Auth Token


This method help to resolve token which is issued by OTPLess which return user detail from that token also this method verify that token is valid, token should not expired and issued by only otpless.com

Method Signature:

Method Params:

Params Data type Mandatory Constraints Remarks
token String true token which you get from OTPLess
clientId String true Your OTPLess Client Id
clientSecret String true Your OTPLess Client Secret

Return

Return: Object Name: UserDetail


4. Generate Magic link


The Authorization Endpoint initiates the authentication process by sending a magic link to the user's WhatsApp or email, based on the provided contact information. This link is used to verify the identity of the user. Upon the user's action on this link, they are redirected to the specified URI with an authorization code included in the redirection.

Method Signature:

Method Params:

Params Data type Mandatory Constraints Remarks
channel String false if no channel given WHATSAPP is chosen as default WHATSAPP/SMS
mobile_number String false At least one required The user's mobile number for authentication in the format: country code + number (e.g., 91XXXXXXXXXX)
email String false At least one required The user's email address for authentication.
redirect_uri String true The URL to which the user will be redirected after authentication. This should be URL-encoded
clientId String true Your OTPLess Client Id
clientSecret String true Your OTPLess Client Secret

Return

Return: Object Name: RquestIds

Example of usage


All versions of otpless-auth-sdk with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/guzzle Version ^7.0
firebase/php-jwt Version ^5.0
phpseclib/phpseclib Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package zsgogo/otpless-auth-sdk contains the following files

Loading the files please wait ....