Documentation ¶
Index ¶
- func BuildLoginResponseRedirectURL(response peregrine.OIDCLoginResponseParams, ...) (string, error)
- func GetCallbackParamsFromRequestFormValues(r *http.Request) (peregrine.OIDCAuthenticationResponse, error)
- func GetLoginParamsFromRequestFormValues(r *http.Request) (peregrine.OIDCLoginRequestParams, error)
- type Config
- type HandleOidcCallbackResponse
- type HandleOidcLoginResponse
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildLoginResponseRedirectURL ¶ added in v0.10.0
func BuildLoginResponseRedirectURL( response peregrine.OIDCLoginResponseParams, platformAuthLoginUrl, callbackUrl string, ) (string, error)
BuildLoginResponseRedirectURL generates a form_post url to redirect to the peregrine.Platform AuthLoginURL
func GetCallbackParamsFromRequestFormValues ¶ added in v0.10.0
func GetCallbackParamsFromRequestFormValues(r *http.Request) (peregrine.OIDCAuthenticationResponse, error)
GetCallbackParamsFromRequestFormValues parses the *http.Request form values and populates peregrine.OIDCAuthenticationResponse
func GetLoginParamsFromRequestFormValues ¶ added in v0.10.0
func GetLoginParamsFromRequestFormValues(r *http.Request) (peregrine.OIDCLoginRequestParams, error)
GetLoginParamsFromRequestFormValues parses the *http.Request form values // and populates peregrine.OIDCLoginRequestParams
Types ¶
type Config ¶
type Config struct { // Issuer (REQUIRED) is the issuer used to sign the state JWT Issuer string // JWTKeySecret (REQUIRED) is the secret used to create the state JWT JWTKeySecret string }
Config holds all the configuration's for Service
type HandleOidcCallbackResponse ¶ added in v0.2.0
type HandleOidcCallbackResponse struct { Claims peregrine.LTI1p3Claims Launch peregrine.Launch }
type HandleOidcLoginResponse ¶ added in v0.2.0
type HandleOidcLoginResponse struct { OIDCLoginResponseParams peregrine.OIDCLoginResponseParams RedirectURL string }
HandleOidcLoginResponse are the return values
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides handlers for the LTI launch
func New ¶
func New(config Config, dataSvc peregrine.ToolDataRepo) *Service
New returns a new Service for handling LTI launch
func (*Service) HandleOidcCallback ¶
func (s *Service) HandleOidcCallback(ctx context.Context, params peregrine.OIDCAuthenticationResponse) ( HandleOidcCallbackResponse, error, )
HandleOidcCallback receives the peregrine.OIDCAuthenticationResponse then validates the state and id_token (with claims) as per http://www.imsglobal.org/spec/security/v1p0/#authentication-response-validation and https://www.imsglobal.org/spec/lti/v1p3#required-message-claims
func (*Service) HandleOidcLogin ¶
func (s *Service) HandleOidcLogin(ctx context.Context, params peregrine.OIDCLoginRequestParams) ( HandleOidcLoginResponse, error, )
HandleOidcLogin receives the peregrine.OIDCLoginRequestParams then validates the request and builds the peregrine.OIDCLoginResponseParams to send the Platform in the redirect to peregrine.Platform AuthLoginURL