
Security News
Researcher Exposes Zero-Day Clickjacking Vulnerabilities in Major Password Managers
Hacker Demonstrates How Easy It Is To Steal Data From Popular Password Managers
devise_oauth2_providable
Advanced tools
Rails3 engine that brings OAuth2 Provider support to your application.
Current OAuth2 Specification Draft: http://tools.ietf.org/html/draft-ietf-oauth-v2-22
# Gemfile
gem 'devise_oauth2_providable'
$ rake devise_oauth2_providable:install:migrations
$ rake db:migrate
# config/routes.rb
Rails.application.routes.draw do
# oauth routes can be mounted to any path (ex: /oauth2 or /oauth)
mount Devise::Oauth2Providable::Engine => '/oauth2'
end
class User
# NOTE: include :database_authenticatable configuration
# if supporting Resource Owner Password Credentials Grant Type
devise :oauth2_providable,
:oauth2_password_grantable,
:oauth2_refresh_token_grantable,
:oauth2_authorization_code_grantable
end
# config/application.rb
config.devise_oauth2_providable.access_token_expires_in = 1.second # 15.minute default
config.devise_oauth2_providable.refresh_token_expires_in = 1.minute # 1.month default
config.devise_oauth2_providable.authorization_token_expires_in = 5.seconds # 1.minute default
registered OAuth2 client for storing the unique client_id and client_secret.
http://tools.ietf.org/html/draft-ietf-oauth-v2-15#section-1.3
Short lived token used by clients to perform subsequent requests (see bearer token spec)
expires after 15min by default. to customize the duration of the access token:
Devise::Oauth2Providable::AccessToken.default_lifetime = 1.minute
http://tools.ietf.org/html/draft-ietf-oauth-v2-15#section-1.5
Long lived token used by clients to request new access tokens without requiring user intervention to re-authorize.
expires after 1 month by default. to customize the duration of refresh token:
Devise::Oauth2Providable::RefreshToken.default_lifetime = 1.year
http://tools.ietf.org/html/draft-ietf-oauth-v2-15#section-1.4.1
Very short lived token created to allow a client to request an access token after a user has gone through the authorization flow.
expires after 1min by default. to customize the duration of the authorization code:
Devise::Oauth2Providable::AuthorizationCode.default_lifetime = 5.minutes
http://tools.ietf.org/html/draft-ietf-oauth-v2-15#section-2.1
Endpoint to start client authorization flow. Models, controllers and views are included for out of the box deployment.
Supports the Authorization Code and Implicit grant types.
http://tools.ietf.org/html/draft-ietf-oauth-v2-15#section-2.2
Endpoint to request access token. See grant type documentation for supported flows.
http://tools.ietf.org/html/draft-ietf-oauth-v2-15#section-4.3
in order to use the Resource Owner Password Credentials Grant Type, your Devise model must be configured with the :database_authenticatable option
http://tools.ietf.org/html/draft-ietf-oauth-v2-15#section-4.4
http://tools.ietf.org/html/draft-ietf-oauth-v2-15#section-4.1
http://tools.ietf.org/html/draft-ietf-oauth-v2-15#section-4.2
http://tools.ietf.org/html/draft-ietf-oauth-v2-15#section-6
See CONTRIBUTORS.txt for list of project contributors
Copyright (c) 2011 Socialcast, Inc. See LICENSE.txt for further details.
FAQs
Unknown package
We found that devise_oauth2_providable demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Hacker Demonstrates How Easy It Is To Steal Data From Popular Password Managers
Security News
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.