@@ -62,10 +62,11 @@ OAuth2::Client.new(
6262 " REDMOND_CLIENT_ID" , # client_id
6363 " REDMOND_CLIENT_SECRET" , # client_secret
6464 auth_scheme: :request_body , # Other modes are supported: :basic_auth, :tls_client_auth, :private_key_jwt
65- token_url: " oauth2/token" , # relative path, except with leading `/`, then absolute path
66- site: " https://login.microsoftonline.com/REDMOND_REDACTED" ) # The base path for token_url when it is relative
67- .client_credentials # There are many other types to choose from!
68- .get_token(resource: " REDMOND_RESOURCE_UUID" )
65+ token_url: " oauth2/token" , # relative path, except with leading `/`, then absolute path
66+ site: " https://login.microsoftonline.com/REDMOND_REDACTED" ,
67+ ). # The base path for token_url when it is relative
68+ client_credentials. # There are many other types to choose from!
69+ get_token(resource: " REDMOND_RESOURCE_UUID" )
6970```
7071
7172NOTE: ` header ` - The content type specified in the ` curl ` is already the default!
@@ -342,7 +343,7 @@ client = OAuth2::Client.new(
342343 site: " https://example.org/nested/directory/on/your/server" ,
343344 authorize_url: " /jaunty/authorize/" ,
344345 token_url: " /stirrups/access_token" ,
345- )
346+ )
346347# => #<OAuth2::Client:0x00000001204c8288 @id="client_id", @secret="client_sec...
347348client.auth_code.authorize_url(redirect_uri: " http://localhost:8080/oauth2/callback" )
348349# => "https://example.org/jaunty/authorize/?client_id=client_id&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Foauth2%2Fcallback&response_type=code"
0 commit comments