// OAuthCallback handles the callback from the identity provider. Displays an error page if there
// was an error. If successful, the user is redirected back to the proxy-service.
OAuthCallback handles the callback from the identity provider. Displays an error page if there
was an error. If successful, the user is redirected back to the proxy-service.
// OAuthCallback handles the callback from the identity provider . Displays an error page if there // was an error . If successful the user is redirected back to the proxy - service .
func (a *Authenticate) OAuthCallback(w http.ResponseWriter, r *http.Request) {
	redirect, err := a.getOAuthCallback(w, r)
	switch h := err.(type) {
	case nil:
		break
	case httputil.HTTPError:
		log.Error().Err(err).Msg("authenticate: oauth callback error")
		httputil.ErrorResponse(w, r, h.Message, h.Code)
		return
	default:
		log.Error().Err(err).Msg("authenticate: unexpected oauth callback error")
		httputil.ErrorResponse(w, r, "Internal Error", http.StatusInternalServerError)
		return
	}
	http.Redirect(w, r, redirect, http.StatusFound)
}
func ( a * Authenticate ) OAuthCallback ( w http . ResponseWriter , r * http . Request ) { redirect , err := a . getOAuthCallback ( w , r ) switch h := err . ( type ) { case nil : break case httputil . HTTPError : log . Error ( ) . Err ( err ) . Msg ( " " ) httputil . ErrorResponse ( w , r , h . Message , h . Code ) return default : log . Error ( ) . Err ( err ) . Msg ( " " ) httputil . ErrorResponse ( w , r , " " , http . StatusInternalServerError ) return } http . Redirect ( w , r , redirect , http . StatusFound ) }
OAuthCallback handles the callback from the identity provider.
OAuthCallback handles the callback from the identity provider .
// redirect back to the proxy-service