truqu/elm-oauth2/2.2.1

NOTE: this package is not compatible with Elm 0.19.1

OAuth.Implicit

The implicit grant type is used to obtain access tokens (it does not support the issuance of refresh tokens) and is optimized for public clients known to operate a particular redirection URI. These clients are typically implemented in a browser using a scripting language such as JavaScript.

This is a 2-step process:

  • The client asks for an authorization and implicit authentication to the OAuth provider: the user is redirected.
  • The provider redirects the user back and the client parses the request query parameters from the url.

After those steps, the client owns an access_token that can be used to authorize any subsequent request.

Authorize

authorize : Authorization -> Cmd msg

Redirects the resource owner (user) to the resource provider server using the specified authorization flow.

In this case, use Token as a responseType

parse : Location -> Result ParseErr ResponseToken

Parse the location looking for a parameters set by the resource provider server after redirecting the resource owner (user).

Fails with ParseErr Empty when there's nothing