authable v0.10.0 Authable.GrantType.RefreshToken

RefreshToken grant type for OAuth2 Authorization Server

Link to this section Summary

Functions

Authorize client for ‘resouce owner’ using client credentials and refresh token

Link to this section Functions

Link to this function authorize(arg1)

Authorize client for ‘resouce owner’ using client credentials and refresh token.

For authorization, authorize function requires a map contains ‘client_id’ and ‘client_secret’ and ‘refresh_token’. With valid credentials; it automatically creates access_token and refresh_token(if enabled via config) then it returns Authable.Model.Token struct, otherwise {:error, Map, :http_status_code}.

Examples

Authable.GrantType.RefreshToken.authorize(%{
  "client_id" => "52024ca6-cf1d-4a9d-bfb6-9bc5023ad56e",
  "client_secret" => "Wi7Y_Q5LU4iIwJArgqXq2Q",
  "refresh_token" => "XJaVz3lCFC9IfifBriA-dw",
  "scope" => "read"
%})

  Authable.GrantType.RefreshToken.authorize(%{
  "client_id" => "52024ca6-cf1d-4a9d-bfb6-9bc5023ad56e",
  "client_secret" => "Wi7Y_Q5LU4iIwJArgqXq2Q",
  "refresh_token" => "XJaVz3lCFC9IfifBriA-dw"
%})