Documentation ¶
Overview ¶
Package identp is an implementation of [Login and Consent Flow](https://www.ory.sh/docs/hydra/oauth2) between ORY Hydra and Werther Identity Provider.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { HydraURL string `envconfig:"hydra_url" required:"true" desc:"an admin URL of ORY Hydra Server"` SessionTTL time.Duration `envconfig:"session_ttl" default:"24h" desc:"a user session's TTL"` ClaimScopes map[string]string `` /* 246-byte string literal not displayed */ }
Config is a Hydra configuration.
type Handler ¶
type Handler struct { Config // contains filtered or unexported fields }
Handler provides HTTP handlers that implement [Login and Consent Flow](https://www.ory.sh/docs/hydra/oauth2) between ORY Hydra and Werther Identity Provider.
func NewHandler ¶
func NewHandler(cnf Config, um UserManager, tr TemplateRenderer) *Handler
NewHandler creates a new Handler.
The template's renderer must be able to render a template with name "login.tmpl". The template is a template of the login page. It receives struct LoginTmplData as template's data.
type LoginTmplData ¶
type LoginTmplData struct { CSRFToken string Challenge string LoginURL string IsInvalidCredentials bool IsInternalError bool }
LoginTmplData is a data that is needed for rendering the login page.
type TemplateRenderer ¶
type TemplateRenderer interface {
RenderTemplate(w http.ResponseWriter, r *http.Request, name string, data interface{}) error
}
TemplateRenderer renders a template with data and writes it to a http.ResponseWriter.
type UserManager ¶
type UserManager interface {
// contains filtered or unexported methods
}
UserManager is an interface that is used for authentication and providing user's claims.