MPX v0.1.7 Mpx.Authentication.Body
Defines types and functions for dealing with authentication body and parameters.
Summary
Functions
Build a x-www-form-urlencoded query string to send in the authentication request to MP
Types
Functions
Build a x-www-form-urlencoded query string to send in the authentication request to MP
If called with an empty list, it will look in the configuration for:
config :mpx,
mp_username: "user",
mp_password: "password",
mp_client_id: "client",
mp_client_secret: "shhh"
If called with just the client_id and client_secret, we assume that you are trying tos authorize a client, so the grant_type is specified as client_credentials
Examples
iex>Mpx.Authentication.Body.get_auth_body(username: “user”, password: “pass”, client_id: “client”, client_secret: “secret”) “username=user&password=pass&client_id=client&client_secret=secret&grant_type=password”
iex>Mpx.Authentication.Body.get_auth_body([]) #pulls data from the configuration “username=user&password=password&client_id=client&client_secret=shhh&grant_type=password”
iex>Mpx.Authentication.Body.get_auth_body(client_id: “client”, client_secret: “password”) “client_id=client&client_secret=password&grant_type=client_credentials”