class Rack::OAuth2::Server::OAuthRequest
Wraps Rack::Request to expose Basic and OAuth authentication credentials.
Constants
- AUTHORIZATION_KEYS
Public Instance Methods
basic?()
click to toggle source
True if authentication scheme is Basic.
# File lib/rack/oauth2/server.rb, line 565 def basic? authorization[/^basic/i] if authorization end
credentials()
click to toggle source
If Basic auth, returns username/password, if OAuth, returns access token.
# File lib/rack/oauth2/server.rb, line 571 def credentials basic? ? authorization.gsub(/\n/, "").split[1].unpack("m*").first.split(/:/, 2) : oauth? ? authorization.gsub(/\n/, "").split[1] : nil end
oauth?()
click to toggle source
True if authentication scheme is OAuth.
# File lib/rack/oauth2/server.rb, line 560 def oauth? authorization[/^oauth/i] if authorization end