omniauth using google openid
✓ Published0🌍 Public
TTBD
Last edited Dec 16, 2011
Created on Dec 16, 2011
This example shows a Sinatra application that authenticates users via Google’s OpenID provider, displaying a login button on the root route and a personalized welcome message on `/app` after successful sign-in. It uses the OmniAuth framework with the `omniauth-openid` adapter, configuring a filesystem-backed OpenID store and a `:google` provider with Google’s discovery identifier. The app handles the callback at `/auth/:name/callback` by extracting user info from the `omniauth.auth` request environment, storing a formatted name and email in Sinatra’s session (enabled via `enable :sessions`), and redirecting to the protected page. Logout clears the session and returns to the root.
AI-generated description