stormpath / laravel
Build simple, secure web applications with Stormpath and Laravel!
Installs: 1 220
Dependents: 0
Suggesters: 0
Security: 0
Stars: 32
Watchers: 23
Forks: 7
Open Issues: 11
Type:laravel-package
Requires
- php: >=5.5
- bretterer/iso_duration_converter: ^0.1.0
- illuminate/http: ~5.1|~5.2
- illuminate/routing: ~5.1|~5.2
- illuminate/support: ~5.1|~5.2
- illuminate/validation: ~5.1|~5.2
- stormpath/sdk: ~1.14
Requires (Dev)
- mockery/mockery: ~0.9
- orchestra/testbench: ~3.2.0
- phpunit/phpunit: ~4.0
Replaces
- stormpath/laravel-auth: 0.5.1
This package is not auto-updated.
Last update: 2020-01-24 16:03:37 UTC
README
#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.
We're available to answer all questions at support@stormpath.com.
Getting Started
Follow these steps to add Stormpath user authentication to your Laravel app.
- Download Your Key File
Download your key file from the Stormpath Console.
- Store Your Key As Environment Variables
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:
STORMPATH_CLIENT_APIKEY_ID=<YOUR-ID-HERE> STORMPATH_CLIENT_APIKEY_SECRET=<YOUR-SECRET-HERE>
- Get Your Stormpath App HREF
Login to the Stormpath Console and grab the HREF (called REST URL in the UI) of your Application. It should look something like this:
https://api.stormpath.com/v1/applications/q42unYAj6PDLxth9xKXdL
- Store Your Stormpath App HREF In the
.env
file
STORMPATH_APPLICATION_HREF=<YOUR-STORMPATH-APP-HREF>
- Install The Package
Open your composer.json file and add the following to your require block:
"stormpath/laravel": "^0.4"
-
Include It In Your App
Open you
config/app.php
file and add the following to your providers section
Stormpath\Laravel\Support\StormpathLaravelServiceProvider::class
- Configure It
To modify the configuration of the package, you will need to publish the config file. Run the following in your terminal:
$ php artisan vendor:publish
- Protect Your Routes
You can use stormpath.auth
as a middleware to protect your routes:
Route::get('/page', ['middleware'=>'stormpath.auth']);
If the user tries to access this route without being logged in, they will be redirected to the login page.
If you want to make sure ONLY guests can use the route, You can use stormpath.guest
as a middleware:
Route::get('/page', ['middleware'=>'stormpath.guest']);
If the user tries to access this route while logged in, they will be redirected to the home page.
- Login
To access a protected route, the user must first login.
You can login by visiting the /login
URL and submitting the login form.
- Register
To be able to login, your users first need an account.
Users can register by visiting the /register
URL and submitting the
registration form.
- That's It!
You just added user authentication to your app with Stormpath. See the documentation for further information on how Stormpath can be used with your Laravel app.
Documentation
For basic documentation of this library, see the documentation.
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.
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.
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.
We regularly maintain this repository, and are quick to review pull requests and accept changes!
Copyright
Copyright © 2013-2015 Stormpath, Inc. and contributors.
This project is open-source via the Apache 2.0 License.