Coder Social home page Coder Social logo

userbase-client-php's Introduction

Userbase client for PHP

About Userbase

Userbase is a micro-service with a REST/JSON API that manages users, organizations and api keys.

A Userbase Client can make calls to a Userbase Server authenticate users, get account details, etc.

Usage

Instantiate the client

Instantiate a new client object:

$url = 'https://joe:[email protected]';
$client = new Client($url);

The provided credentials need to have "Admin" privileges on the Userbase Server.

Check credentials

if (!$client->checkCredentials('alice', 'shhhh')) {
  exit('Invalid credentials');
}
echo 'Welcome back!';

Testing/Development

The examples/ directory contains a few example scripts that you can use during testing and development.

First, copy the .env.dist file to .env. Edit the contents to match your Userbase server and credentials.

cp .env.dist .env e
edit .env # Edit configuration, database settings etc
 ./vendor/bin/envoi validate  # Run command validate based on meta file .env.yaml

Then you can simply execute the examples like this:

php examples/checkcredentials.php alice sshhh

Please refer to the examples/ directory for other examples.

Integrations

Silex

A Silex Provider is available here

Symfony

A Symfony bundle can be found here. It works with Symfony 4 and 5 projects.

License

MIT. Please refer to the license file for details.

Brought to you by the LinkORB Engineering team


Check out our other projects at linkorb.com/engineering.

Btw, we're hiring!

userbase-client-php's People

Contributors

boite avatar h-wang avatar joostfaassen avatar prajapati-kaushik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

userbase-client-php's Issues

Needs to be made to work with Symfony 5

symfony/security, on which this client lib depends, is now four separate packages which makes it practically impossible for this lib to work in a Symfony 5 app.

It may be necessary to make other changes too; see the upgrade guide.

Maybe we should branch or fork this lib for Symfony 4.4 and 5 apps or maybe we can do some magic and split the security bits of this lib from the client bits.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.