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"`
230
+
casecode==http.StatusForbidden:
231
+
wwwAuth=`Bearer realm="coder", error="insufficient_scope", error_description="The request requires higher privileges than provided by the access token"`
232
+
}
233
+
234
+
rw.Header().Set("WWW-Authenticate", wwwAuth)
235
+
}
236
+
217
237
httpapi.Write(ctx, rw, code, response)
218
238
returnnil, nil, false
219
239
}
@@ -720,9 +740,14 @@ func UserRBACSubject(ctx context.Context, db database.Store, userID uuid.UUID, s
720
740
// 1: The cookie
721
741
// 2. The coder_session_token query parameter
722
742
// 3. The custom auth header
743
+
// 4. RFC 6750 Authorization: Bearer header
744
+
// 5. RFC 6750 access_token query parameter
723
745
//
724
746
// API tokens for apps are read from workspaceapps/cookies.go.
725
747
funcAPITokenFromRequest(r*http.Request) string {
748
+
// Prioritize existing Coder custom authentication methods first
749
+
// to maintain backward compatibility and existing behavior
0 commit comments