Use 202 for token polling endpoint instead of 204 (#1103)

This commit is contained in:
Jeff Mitchell authored and GitHub committed 2021-04-12 14:57:14 -04:00
1 parent 71673ea161
commit 90b30bad25
6 files changed
+585 -684

No files matched your search

@@ -16,6 +16,7 @@ import (
"github.com/hashicorp/boundary/internal/servers/controller/handlers"
"github.com/hashicorp/boundary/internal/types/action"
"google.golang.org/grpc/codes"
"google.golang.org/protobuf/types/known/structpb"
)
const (
@@ -25,7 +26,8 @@ const (
tokenCommand = "token"
// token request/response fields
tokenField = "token"
tokenField = "token"
statusField = "status"
// field names
issuerField = "attributes.issuer"
@@ -269,7 +271,16 @@ func (s Service) authenticateOidcToken(ctx context.Context, req *pbs.Authenticat
}
}
if token == nil {
return nil, nil
attrs, err := structpb.NewStruct(map[string]interface{}{
statusField: "unknown",
})
if err != nil {
return nil, errors.New(errors.Internal, op, "Error generating response attributes.")
}
return &pbs.AuthenticateResponse{
Command: req.Command,
Attributes: attrs,
}, nil
}
responseToken, err := s.convertInternalAuthTokenToApiAuthToken(