Class: Ape::GoogleLoginCredentials
- Inherits:
-
Object
- Object
- Ape::GoogleLoginCredentials
- Defined in:
- lib/ape/auth/google_login_credentials.rb
Constant Summary collapse
- GOOGLE_ERROR_MESSAGES =
{ "BadAuthentication" => "The login request used a username or password that is not recognized.", "NotVerified" => "The account email address has not been verified. The user will need to access their Google account directly to resolve the issue before logging in using a non-Google application.", "TermsNotAgreed" => "The user has not agreed to terms. The user will need to access their Google account directly to resolve the issue before logging in using a non-Google application.", "CaptchaRequired" => "Please visit https://www.google.com/accounts/DisplayUnlockCaptcha to enable access.", "Unknown" => "The error is unknown or unspecified; the request contained invalid input or was malformed.", "AccountDeleted" => "The user account has been deleted.", "AccountDisabled" => "The user account has been disabled.", "ServiceDisabled" => "The user's access to the specified service has been disabled. (The user account may still be valid.)", "ServiceUnavailable" => "The service is not available; try again later.", }
Instance Method Summary collapse
- #add_credentials(req, auth, user, password) ⇒ Object
-
#initialize ⇒ GoogleLoginCredentials
constructor
A new instance of GoogleLoginCredentials.
Constructor Details
#initialize ⇒ GoogleLoginCredentials
Returns a new instance of GoogleLoginCredentials.
23 24 25 |
# File 'lib/ape/auth/google_login_credentials.rb', line 23 def initialize @credentials = nil end |
Instance Method Details
#add_credentials(req, auth, user, password) ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/ape/auth/google_login_credentials.rb', line 27 def add_credentials(req, auth, user, password) unless @credentials challenge = parse_www_authenticate(auth) @credentials = googlelogin(username, password, 'ruby-ape-1.0', challenge) end req['Authorization'] = "GoogleLogin auth=#{@credentials}" end |