Class: OAuthApp
- Inherits:
-
Sinatra::Base
- Object
- Sinatra::Base
- OAuthApp
- Defined in:
- examples/oauth_flow.rb
Overview
OAuth flow example using Sinatra
Constant Summary collapse
- @@token_store =
Store tokens in memory (use a proper store in production)
{}
Instance Method Summary collapse
-
#oauth_client(request = nil) ⇒ Object
OAuth client configuration.
Instance Method Details
#oauth_client(request = nil) ⇒ Object
OAuth client configuration
25 26 27 28 29 30 31 32 33 34 |
# File 'examples/oauth_flow.rb', line 25 def oauth_client(request = nil) # Always use the ngrok URL from environment redirect_uri = ENV.fetch("ATTIO_REDIRECT_URI", "http://localhost:4567/callback") Attio::OAuth::Client.new( client_id: ENV.fetch("ATTIO_CLIENT_ID", nil), client_secret: ENV.fetch("ATTIO_CLIENT_SECRET", nil), redirect_uri: redirect_uri ) end |