Reference documentation and code samples for the googleauth class Google::Auth::WebUserAuthorizer::CallbackApp.
Small Rack app which acts as the default callback handler for the app.
To configure in Rails, add to routes.rb:
match '/oauth2callback',
to: Google::Auth::WebUserAuthorizer::CallbackApp,
via: :all
With Rackup, add to config.ru:
map '/oauth2callback' do
run Google::Auth::WebUserAuthorizer::CallbackApp
end
Or in a classic Sinatra app:
get('/oauth2callback') do
Google::Auth::WebUserAuthorizer::CallbackApp.call(env)
end
Inherits
Object
Methods
.call
defself.call(env)->Array
Handle a rack request. Simply stores the results the authorization
in the session temporarily and redirects back to to the previously
saved redirect URL. Credentials can be later retrieved by calling.
{Google::Auth::Web::WebUserAuthorizer#get_credentials}
See {Google::Auth::Web::WebUserAuthorizer#get_authorization_uri}
for how to initiate authorization requests.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-09 UTC."],[],[],null,["# googleauth - Class Google::Auth::WebUserAuthorizer::CallbackApp (v1.15.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.15.0 (latest)](/ruby/docs/reference/googleauth/latest/Google-Auth-WebUserAuthorizer-CallbackApp)\n- [1.14.0](/ruby/docs/reference/googleauth/1.14.0/Google-Auth-WebUserAuthorizer-CallbackApp)\n- [1.13.1](/ruby/docs/reference/googleauth/1.13.1/Google-Auth-WebUserAuthorizer-CallbackApp)\n- [1.12.2](/ruby/docs/reference/googleauth/1.12.2/Google-Auth-WebUserAuthorizer-CallbackApp) \nReference documentation and code samples for the googleauth class Google::Auth::WebUserAuthorizer::CallbackApp.\n\nSmall Rack app which acts as the default callback handler for the app.\n\nTo configure in Rails, add to routes.rb: \n\n match '/oauth2callback',\n to: Google::Auth::WebUserAuthorizer::CallbackApp,\n via: :all\n\nWith Rackup, add to config.ru: \n\n map '/oauth2callback' do\n run Google::Auth::WebUserAuthorizer::CallbackApp\n end\n\nOr in a classic Sinatra app: \n\n get('/oauth2callback') do\n Google::Auth::WebUserAuthorizer::CallbackApp.call(env)\n end\n\nInherits\n--------\n\n- Object\n\nMethods\n-------\n\n### .call\n\n def self.call(env) -\u003e Array\n\nHandle a rack request. Simply stores the results the authorization\nin the session temporarily and redirects back to to the previously\nsaved redirect URL. Credentials can be later retrieved by calling.\n{Google::Auth::Web::WebUserAuthorizer#get_credentials}\n\n\n\u003cbr /\u003e\n\nSee {Google::Auth::Web::WebUserAuthorizer#get_authorization_uri}\nfor how to initiate authorization requests. \n**Parameter**\n\n- **env** (Hash) --- Rack environment \n**Returns**\n\n- (Array) --- HTTP response\n\n### #call\n\n def call(env)\n\nConstants\n---------\n\n### LOCATION_HEADER\n\n**value:**\"Location\".freeze\n\n### REDIR_STATUS\n\n**value:**302\n\n### ERROR_STATUS\n\n**value:**500"]]