AshAtproto.Auth.Plug (ash_atproto v1.0.0)

Copy Markdown

A Plug for the atproto oauth strategy.

Provides routes for the oauth phases of request and callback, along with a client metadata JSON.

Summary

Functions

Perform the callback phase of atproto oauth.

Perform the request phase of atproto oauth.

Functions

callback(conn, strategy)

@spec callback(Plug.Conn.t(), AshAtproto.Auth.t()) :: Plug.Conn.t()

Perform the callback phase of atproto oauth.

Responds to a user being redirected back from the remote authentication provider, and validates the passed options, ultimately registering or signing-in a user if the authentication was successful.

client_metadata(conn, strategy)

@spec client_metadata(Plug.Conn.t(), AshAtproto.Auth.t()) :: Plug.Conn.t()

request(conn, strategy)

@spec request(Plug.Conn.t(), AshAtproto.Auth.t()) :: Plug.Conn.t()

Perform the request phase of atproto oauth.

Builds a redirection URL based on the provider configuration and redirects the user to that endpoint.