outposts: send SelectedChallenge when using MFA with Go FlowExecutor

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-11-11 21:27:06 +01:00
parent 8a24ddad28
commit 00324f922d

View file

@ -130,8 +130,8 @@ func (fe *FlowExecutor) getAnswer(stage StageComponent) string {
// WarmUp Ensure authentik's flow cache is warmed up // WarmUp Ensure authentik's flow cache is warmed up
func (fe *FlowExecutor) WarmUp() error { func (fe *FlowExecutor) WarmUp() error {
defer fe.sp.Finish()
gcsp := sentry.StartSpan(fe.Context, "authentik.outposts.flow_executor.get_challenge") gcsp := sentry.StartSpan(fe.Context, "authentik.outposts.flow_executor.get_challenge")
defer gcsp.Finish()
req := fe.api.FlowsApi.FlowsExecutorGet(gcsp.Context(), fe.flowSlug).Query(fe.Params.Encode()) req := fe.api.FlowsApi.FlowsExecutorGet(gcsp.Context(), fe.flowSlug).Query(fe.Params.Encode())
_, _, err := req.Execute() _, _, err := req.Execute()
return err return err
@ -190,6 +190,7 @@ func (fe *FlowExecutor) solveFlowChallenge(depth int) (bool, error) {
} }
devId32 := int32(devId) devId32 := int32(devId)
inner := api.NewAuthenticatorValidationChallengeResponseRequest() inner := api.NewAuthenticatorValidationChallengeResponseRequest()
inner.SelectedChallenge = (*api.DeviceChallengeRequest)(deviceChallenge)
inner.Duo = &devId32 inner.Duo = &devId32
responseReq = responseReq.FlowChallengeResponseRequest(api.AuthenticatorValidationChallengeResponseRequestAsFlowChallengeResponseRequest(inner)) responseReq = responseReq.FlowChallengeResponseRequest(api.AuthenticatorValidationChallengeResponseRequestAsFlowChallengeResponseRequest(inner))
case string(StageAccessDenied): case string(StageAccessDenied):