Steamex v0.0.9 Steamex.Auth View Source

Functions related to authenticating with the Steam OpenID provider.

Link to this section Summary

Functions

Returns the URL you should direct your users to in order to log in

Validate a “return_to” payload from Steam

Link to this section Functions

Link to this function auth_url(realm, return_to) View Source
auth_url(String.t(), String.t()) :: String.t()

Returns the URL you should direct your users to in order to log in.

realm should be set to your base URL, i.e. “http://example.com”.

return_to is the URL that Steam will redirect to after a successful auth. If you use Steamex.Auth.Phoenix, this is realm <> "/steamex/return_to" by default.

Link to this function validate_payload(payload, httpoison \\ HTTPoison) View Source
validate_payload(map(), atom()) :: integer()

Validate a “return_to” payload from Steam.

You probably want to use Steamex.Auth.Plug/Steamex.Auth.Phoenix to handle this for you, but it’s here in case you want to validate payloads manually.

This function will raise an exception if validation fails, or return the user’s Steam ID as an integer if it succeeds.