You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
wwwAuth=`Bearer realm="coder", error="invalid_token", error_description="The access token audience does not match this resource"`
229
+
casecode==http.StatusForbidden:
230
+
wwwAuth=`Bearer realm="coder", error="insufficient_scope", error_description="The request requires higher privileges than provided by the access token"`
231
+
}
232
+
233
+
rw.Header().Set("WWW-Authenticate", wwwAuth)
234
+
}
235
+
216
236
httpapi.Write(ctx, rw, code, response)
217
237
returnnil, nil, false
218
238
}
@@ -539,9 +559,14 @@ func UserRBACSubject(ctx context.Context, db database.Store, userID uuid.UUID, s
539
559
// 1: The cookie
540
560
// 2. The coder_session_token query parameter
541
561
// 3. The custom auth header
562
+
// 4. RFC 6750 Authorization: Bearer header
563
+
// 5. RFC 6750 access_token query parameter
542
564
//
543
565
// API tokens for apps are read from workspaceapps/cookies.go.
544
566
funcAPITokenFromRequest(r*http.Request) string {
567
+
// Prioritize existing Coder custom authentication methods first
568
+
// to maintain backward compatibility and existing behavior
0 commit comments