Skip to content

Commit dd65db1

Browse files
authored
fix(sdk): this (enforceDPoP) flag needs to be flipped (#649)
the flag was inverted incorrectly
1 parent 028064c commit dd65db1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

service/internal/auth/authn.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ func (a Authentication) checkToken(ctx context.Context, authHeader []string, dpo
312312
}
313313

314314
_, tokenHasCNF := accessToken.Get("cnf")
315-
if !tokenHasCNF && a.enforceDPoP {
315+
if !tokenHasCNF && !a.enforceDPoP {
316316
// this condition is not quite tight because it's possible that the `cnf` claim may
317317
// come from token introspection
318318
return accessToken, ctx, nil

service/internal/auth/authn_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ func (s *AuthSuite) SetupTest() {
144144
context.Background(),
145145
Config{
146146
AuthNConfig: AuthNConfig{
147-
EnforceDPoP: false,
147+
EnforceDPoP: true,
148148
Issuer: s.server.URL,
149149
Audience: "test",
150150
},
@@ -548,7 +548,7 @@ func makeDPoPToken(t *testing.T, tc dpopTestCase) string {
548548

549549
func (s *AuthSuite) Test_Allowing_Auth_With_No_DPoP() {
550550
authnConfig := AuthNConfig{
551-
EnforceDPoP: true,
551+
EnforceDPoP: false,
552552
Issuer: s.server.URL,
553553
Audience: "test",
554554
}

0 commit comments

Comments
 (0)