2017 © Pedro Peláez
 

laravel-package lumen

Build simple, secure web applications with Stormpath and Laravel!

image

stormpath/lumen

Build simple, secure web applications with Stormpath and Laravel!

  • Tuesday, March 7, 2017
  • by bretterer
  • Repository
  • 17 Watchers
  • 10 Stars
  • 235 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 5 Open issues
  • 20 Versions
  • 0 % Grown

The README.md

Stormpath is Joining Okta

We are incredibly excited to announce that Stormpath is joining forces with Okta. Please visit the Migration FAQs for a detailed look at what this means for Stormpath users., (*1)

We're available to answer all questions at support@stormpath.com., (*2)

Latest Stable Version Latest Unstable Version License Chat Chat, (*3)

Getting Started

Follow these steps to add Stormpath user authentication to your Lumen app., (*4)

  1. Download Your Key File, (*5)

    Download your key file from the Stormpath Console., (*6)

  2. Store Your Key As Environment Variables, (*7)

    Open your key file and grab the API Key ID and API Key Secret, then add this to your .env file in the root of your project:, (*8)

    You may need to create a .env file if this is a fresh install of lumen., (*9)

    STORMPATH_CLIENT_APIKEY_ID=<YOUR-ID-HERE>
    STORMPATH_CLIENT_APIKEY_SECRET=<YOUR-SECRET-HERE>
    
  3. Get Your Stormpath Application HREF, (*10)

    Login to the Stormpath Console and grab the HREF (called REST URL in the UI) of your Application. It should look something like this:, (*11)

    https://api.stormpath.com/v1/applications/q42unYAj6PDLxth9xKXdL, (*12)

  4. Store Your Stormpath App HREF In the .env file, (*13)

    STORMPATH_APPLICATION_HREF=<YOUR-STORMPATH-APP-HREF>
    
  5. Install The Package, (*14)

    Open your composer.json file and add the following to your require block:, (*15)

    "stormpath/lumen": "^0.1"
    
  6. Include It In Your App, (*16)

    Open you bootstrap/app.php file and add the following to your providers section, (*17)

    $app->register(\Stormpath\Lumen\Support\StormpathServiceProvider::class);
    
  7. Configure It, (*18)

    To modify the configuration of the package, you will need to publish the config file. Run the following in your terminal:, (*19)

    $ php artisan stormpath:config
    

    This will create a stormpath.yaml file in the root of your project with all the options you are able to modify. By default, Login, Logout, OAuth, and Register routes will be enabled. Other routes will be enabled based on your directory settings., (*20)

  8. Login, (*21)

    Working with an API, we suggest that you work with OAuth tokens. We have created a route for your, /oauth/tokens where you can do client_credentials, password, or refresh grant types., (*22)

  • Client Credentials, (*23)

    In this workflow, an api key and secret is provisioned for a stormpath account. These credentials can be exchanged for an access token by making a POST request to /oauth/token on the web application. The request must look like this:, (*24)

    POST /oauth/token
    Authorization: Basic <base64UrlEncoded(apiKeyId:apiKeySecret)>
    
    grant_type=client_credentials
    
  • Password Grant, (*25)

    In this workflow, an account can post their login (username or email) and password to the ``/oauth/token` endpoint, with the following body data:, (*26)

    POST /oauth/token
    
    grant_type=password
    &username=<username>
    &password=<password>
    
  • Refresh Grant, (*27)

    The refresh grant type is required for clients using the password grant type to refresh their access_token. Thus, it's automatically enabled alongside the password grant type., (*28)

    An account can post their refresh_token with the following body data:, (*29)

    POST /oauth/token
    grant_type=refresh_token&
    refresh_token=<refresh token>
    

    The product guide for token management: http://docs.stormpath.com/guides/token-management, (*30)

  1. Register, (*31)

    To get the model for the registration form, make a GET request to /register. This will return a JSON representation of the form along with the available Account Stores., (*32)

    {
     "form": {
       "fields": [
         {
           "enabled": true,
           "label": "First Name",
           "placeholder": "First Name",
           "required": true,
           "type": "text"
         },
         {
           "enabled": true,
           "label": "Last Name",
           "placeholder": "Last Name",
           "required": true,
           "type": "text"
         },
         ...
       ]
     },
     "accountStores": [
       {
         "href": "https://api.stormpath.com/v1/directories/6t1orcyGhqLvObgvsohdYu",
         "name": "Test Directory",
         "provider": {
           "href": "https://api.stormpath.com/v1/directories/6t1orcyGhqLvObgvsohdYu/provider",
           "providerId": "stormpath"
         }
       }
     ]
    }
    

    When you want to register a new Account, take the user data from the form model and put into the body of a POST request to the /register endpoint., (*33)

  2. That's It!, (*34)

    You just added user authentication to your app with Stormpath., (*35)

Support

If you are having issues with this package, please feel free to submit an issue on this github repository. If it is an issue you are having that needs a little more private attention, please feel free to contact us at support@stormpath.com or visit our support center., (*36)

Contributing

We welcome anyone to make contributions to this project. Just fork the develop branch of this repository, make your changes, then issue a pull request on the develop branch., (*37)

Any pull request you make will need to have associated tests with them. If a test is not provided, the pull request will be closed automatically. Also, any pull requests made to a branch other than develop will be closed and a new submission will need to be made to the develop branch., (*38)

We regularly maintain this repository, and are quick to review pull requests and accept changes!, (*39)

Copyright © 2013-2016 Stormpath, Inc. and contributors., (*40)

This project is open-source via the Apache 2.0 License., (*41)

The Versions

07/03 2017

dev-master

9999999-dev

Build simple, secure web applications with Stormpath and Laravel!

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

laravel authentication authorization accounts users stormpath

06/03 2017

dev-okta-readme-update

dev-okta-readme-update

Build simple, secure web applications with Stormpath and Laravel!

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

laravel authentication authorization accounts users stormpath

10/01 2017

dev-robertjd-patch-1

dev-robertjd-patch-1

Build simple, secure web applications with Stormpath and Laravel!

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

laravel authentication authorization accounts users stormpath

30/12 2016

dev-update-sphinx-theme

dev-update-sphinx-theme

Build simple, secure web applications with Stormpath and Laravel!

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

laravel authentication authorization accounts users stormpath

21/12 2016

dev-develop

dev-develop

Build simple, secure web applications with Stormpath and Laravel!

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

laravel authentication authorization accounts users stormpath

21/12 2016
21/12 2016

dev-docs-update

dev-docs-update

Build simple, secure web applications with Stormpath and Laravel!

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

laravel authentication authorization accounts users stormpath

17/10 2016
27/09 2016

dev-simpler-deployment

dev-simpler-deployment

Build simple, secure web applications with Stormpath and Laravel!

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

laravel authentication authorization accounts users stormpath

22/09 2016

dev-updated-theme

dev-updated-theme

Build simple, secure web applications with Stormpath and Laravel!

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

laravel authentication authorization accounts users stormpath

20/09 2016
20/09 2016

dev-release/0.1.6

dev-release/0.1.6

Build simple, secure web applications with Stormpath and Laravel!

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

laravel authentication authorization accounts users stormpath

20/09 2016

dev-feature/LoginIT_TCK

dev-feature/LoginIT_TCK

Build simple, secure web applications with Stormpath and Laravel!

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

laravel authentication authorization accounts users stormpath

02/08 2016
02/08 2016

dev-clientCredentialUpdates

dev-clientCredentialUpdates

Build simple, secure web applications with Stormpath and Laravel!

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

laravel authentication authorization accounts users stormpath

14/06 2016
18/05 2016
04/05 2016
16/04 2016
16/04 2016