Update README

This commit is contained in:
tmilewski 2017-09-28 15:02:16 -04:00
parent 1076a1c18d
commit c21edf46ee
No known key found for this signature in database
GPG Key ID: 60478E252CC674E7
1 changed files with 33 additions and 7 deletions

View File

@ -122,6 +122,32 @@ environment information on the callback request. It is entirely up to
you how you want to implement the particulars of your application's you how you want to implement the particulars of your application's
authentication flow. authentication flow.
## Configuring The `origin` Param
The `origin` url parameter is typically used to inform where a user came from and where, should you choose to use it, they'd want to return to.
There are three possible options:
Default Flow:
```ruby
# /auth/twitter/?origin=[URL]
# No change
# If blank, `omniauth.origin` is set to HTTP_REFERER
```
Renaming Origin Param:
```ruby
# /auth/twitter/?return_to=[URL]
# If blank, `omniauth.origin` is set to HTTP_REFERER
provider :twitter, ENV['KEY'], ENV['SECRET'], origin_param: 'return_to'
```
Disabling Origin Param:
```ruby
# /auth/twitter
# Origin handled externally, if need be. `omniauth.origin` is not set
provider :twitter, ENV['KEY'], ENV['SECRET'], origin_param: false
```
## Integrating OmniAuth Into Your Rails API ## Integrating OmniAuth Into Your Rails API
The following middleware are (by default) included for session management in The following middleware are (by default) included for session management in
Rails applications. When using OmniAuth with a Rails API, you'll need to add Rails applications. When using OmniAuth with a Rails API, you'll need to add