mirror of
https://github.com/andwati/zitadel.git
synced 2026-12-01 16:38:52 +00:00
# Which Problems Are Solved Correctly display callback URL's in the console for external identity providers. <img width="1965" height="527" alt="CleanShot 2026-01-21 at 14 21 56" src="https://github.com/user-attachments/assets/149fa74d-02d9-4e81-9933-a16eaeac316d" /> # How the Problems Are Solved Changed the template string in the console to match the correct endpoint. # Additional Changes # Additional Context - Closes #11053 Co-authored-by: Marco A. <[email protected]>
This commit is contained in:
@@ -25,7 +25,7 @@ import TestSetup from './_test_setup.mdx';
|
|||||||
4. Go to the Auth Settings of the App and add the following URL to the "Authorized redirect URLs"
|
4. Go to the Auth Settings of the App and add the following URL to the "Authorized redirect URLs"
|
||||||
- Login V1: `${CUSTOM_DOMAIN}/ui/login/login/externalidp/callback`
|
- Login V1: `${CUSTOM_DOMAIN}/ui/login/login/externalidp/callback`
|
||||||
- Example redirect url for the domain `https://acme.zitadel.cloud` would look like this: `https://acme.zitadel.cloud/ui/login/login/externalidp/callback`
|
- Example redirect url for the domain `https://acme.zitadel.cloud` would look like this: `https://acme.zitadel.cloud/ui/login/login/externalidp/callback`
|
||||||
- Login V2: `${LOGINGV2_DOMAIN}/idps/callback`
|
- Login V2: `${CUSTOM_DOMAIN}/idps/callback`
|
||||||
- In this case the url would look like this: `https://acme.zitadel.cloud/idps/callback`
|
- In this case the url would look like this: `https://acme.zitadel.cloud/idps/callback`
|
||||||
5. Verify the app as your company
|
5. Verify the app as your company
|
||||||
6. In the Auth - OAuth 2.0 scopes section you should see `openid`, `profile` and `email` listed
|
6. In the Auth - OAuth 2.0 scopes section you should see `openid`, `profile` and `email` listed
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Injectable, Injector, Type } from '@angular/core';
|
import { Injectable, Injector, Type } from '@angular/core';
|
||||||
import { BehaviorSubject, combineLatestWith, defer, from, Observable, of, shareReplay, switchMap, take } from 'rxjs';
|
import { BehaviorSubject, combineLatestWith, from, Observable, of, shareReplay, switchMap, take } from 'rxjs';
|
||||||
import { catchError, filter, map, timeout } from 'rxjs/operators';
|
import { filter, map } from 'rxjs/operators';
|
||||||
import { EnvironmentService } from 'src/app/services/environment.service';
|
import { EnvironmentService } from 'src/app/services/environment.service';
|
||||||
import { CopyUrl } from './provider-next.component';
|
import { CopyUrl } from './provider-next.component';
|
||||||
import { ManagementService } from 'src/app/services/mgmt.service';
|
import { ManagementService } from 'src/app/services/mgmt.service';
|
||||||
@@ -10,36 +10,17 @@ import { ToastService } from 'src/app/services/toast.service';
|
|||||||
import { Data, ParamMap } from '@angular/router';
|
import { Data, ParamMap } from '@angular/router';
|
||||||
import { LoginPolicyService } from 'src/app/services/login-policy.service';
|
import { LoginPolicyService } from 'src/app/services/login-policy.service';
|
||||||
import { PolicyComponentServiceType } from '../../policies/policy-component-types.enum';
|
import { PolicyComponentServiceType } from '../../policies/policy-component-types.enum';
|
||||||
import { NewFeatureService } from 'src/app/services/new-feature.service';
|
|
||||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class ProviderNextService {
|
export class ProviderNextService {
|
||||||
private readonly loginV2BaseUri$: Observable<string | undefined>;
|
|
||||||
constructor(
|
constructor(
|
||||||
private readonly env: EnvironmentService,
|
private readonly env: EnvironmentService,
|
||||||
private readonly toast: ToastService,
|
private readonly toast: ToastService,
|
||||||
private readonly loginPolicySvc: LoginPolicyService,
|
private readonly loginPolicySvc: LoginPolicyService,
|
||||||
private readonly injector: Injector,
|
private readonly injector: Injector,
|
||||||
private readonly featureService: NewFeatureService,
|
) {}
|
||||||
) {
|
|
||||||
this.loginV2BaseUri$ = this.getLoginV2BaseUri();
|
|
||||||
}
|
|
||||||
|
|
||||||
private getLoginV2BaseUri(): Observable<string | undefined> {
|
|
||||||
return defer(() => this.featureService.getInstanceFeatures()).pipe(
|
|
||||||
timeout(1000),
|
|
||||||
// we try to load the features if this fails or takes too long we just assume loginV2 is not available
|
|
||||||
catchError(() => of({ loginV2: undefined })),
|
|
||||||
map((features) => features?.loginV2?.baseUri),
|
|
||||||
// we only try this once as the backup plan is not too bad
|
|
||||||
// and in most cases this will work
|
|
||||||
shareReplay({ refCount: false, bufferSize: 1 }),
|
|
||||||
takeUntilDestroyed(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
service(routeData: Observable<Data>): Observable<ManagementService | AdminService> {
|
service(routeData: Observable<Data>): Observable<ManagementService | AdminService> {
|
||||||
return routeData.pipe(
|
return routeData.pipe(
|
||||||
@@ -101,17 +82,14 @@ export class ProviderNextService {
|
|||||||
|
|
||||||
callbackUrls(): Observable<CopyUrl[]> {
|
callbackUrls(): Observable<CopyUrl[]> {
|
||||||
return this.env.env.pipe(
|
return this.env.env.pipe(
|
||||||
combineLatestWith(this.loginV2BaseUri$),
|
map((env) => [
|
||||||
map(([env, loginV2BaseUri]) => [
|
|
||||||
{
|
{
|
||||||
label: 'Login V1 Callback URL',
|
label: 'Login V1 Callback URL',
|
||||||
url: `${env.issuer}/ui/login/login/externalidp/callback`,
|
url: `${env.issuer}/ui/login/login/externalidp/callback`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Login V2 Callback URL',
|
label: 'Login V2 Callback URL',
|
||||||
// if we don't have a loginV2BaseUri we provide a placeholder url so the user knows what to fill in
|
url: `${env.issuer}/idps/callback`,
|
||||||
// this is not ideal but better than nothing
|
|
||||||
url: loginV2BaseUri ? `${loginV2BaseUri}idps/callback` : '{LOGIN V2 Hostname}/idps/callback',
|
|
||||||
},
|
},
|
||||||
]),
|
]),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user