Module: Office365::REST::Token
- Included in:
- API
- Defined in:
- lib/office365/rest/token.rb
Instance Method Summary collapse
Instance Method Details
#authorize_url ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/office365/rest/token.rb', line 6 def base_uri = [LOGIN_HOST, "/#{tenant_id}/oauth2/v2.0/authorize"].join azure_params = { client_id: client_id, client_secret: client_secret, scope: Office365::SCOPE, response_type: "code", response_mode: "query", redirect_uri: redirect_uri, state: SecureRandom.hex }.ms_hash_to_query [base_uri, "?", azure_params].join end |
#refresh_token! ⇒ Object
25 26 27 28 29 |
# File 'lib/office365/rest/token.rb', line 25 def refresh_token! Models::AccessToken.new( Request.new(nil, debug: debug).post(token_url, token_params) ) end |
#token_url ⇒ Object
21 22 23 |
# File 'lib/office365/rest/token.rb', line 21 def token_url [LOGIN_HOST, "/#{tenant_id}/oauth2/v2.0/token"].join end |