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