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"`
225
+
casecode==http.StatusForbidden:
226
+
wwwAuth=`Bearer realm="coder", error="insufficient_scope", error_description="The request requires higher privileges than provided by the access token"`
227
+
}
228
+
229
+
rw.Header().Set("WWW-Authenticate", wwwAuth)
230
+
}
231
+
212
232
httpapi.Write(ctx, rw, code, response)
213
233
returnnil, nil, false
214
234
}
@@ -534,9 +554,14 @@ func UserRBACSubject(ctx context.Context, db database.Store, userID uuid.UUID, s
534
554
// 1: The cookie
535
555
// 2. The coder_session_token query parameter
536
556
// 3. The custom auth header
557
+
// 4. RFC 6750 Authorization: Bearer header
558
+
// 5. RFC 6750 access_token query parameter
537
559
//
538
560
// API tokens for apps are read from workspaceapps/cookies.go.
539
561
funcAPITokenFromRequest(r*http.Request) string {
562
+
// Prioritize existing Coder custom authentication methods first
563
+
// to maintain backward compatibility and existing behavior
0 commit comments