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