Skip to content

Commit 4bd9924

Browse files
nandajavarmageropl
andauthored
[oidc] Fix the HEAD method call that checks reachability (#20474)
* [oidc] Fix the HEAD method call that checks reachability * [server] Fix setup flow --------- Co-authored-by: Gero Posmyk-Leinemann <gero@gitpod.io>
1 parent 7a27ea0 commit 4bd9924

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

components/public-api-server/pkg/apiv1/oidc.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ func assertIssuerIsReachable(ctx context.Context, issuer *url.URL) error {
493493
},
494494
}
495495

496-
req, err := http.NewRequestWithContext(ctx, http.MethodHead, issuer.String(), nil)
496+
req, err := http.NewRequestWithContext(ctx, http.MethodHead, issuer.String()+"/.well-known/openid-configuration", nil)
497497
if err != nil {
498498
return err
499499
}

components/server/src/user/user-authentication.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import { injectable, inject } from "inversify";
88
import { User, Identity, Token, IdentityLookup } from "@gitpod/gitpod-protocol";
9-
import { EmailDomainFilterDB, MaybeUser, UserDB } from "@gitpod/gitpod-db/lib";
9+
import { BUILTIN_INSTLLATION_ADMIN_USER_ID, EmailDomainFilterDB, MaybeUser, UserDB } from "@gitpod/gitpod-db/lib";
1010
import { HostContextProvider } from "../auth/host-context-provider";
1111
import { log } from "@gitpod/gitpod-protocol/lib/util/logging";
1212
import { Config } from "../config";
@@ -214,7 +214,10 @@ export class UserAuthentication {
214214
const isMultiOrgEnabled = await getExperimentsClientForBackend().getValueAsync("enable_multi_org", false, {
215215
gitpodHost: this.config.hostUrl.url.host,
216216
});
217-
return isAllowedToCreateOrganization(user, isDedicated, isMultiOrgEnabled);
217+
return (
218+
isAllowedToCreateOrganization(user, isDedicated, isMultiOrgEnabled) ||
219+
(isDedicated && user.id === BUILTIN_INSTLLATION_ADMIN_USER_ID)
220+
);
218221
}
219222

220223
async isBlocked(params: CheckIsBlockedParams): Promise<boolean> {

0 commit comments

Comments
 (0)