Skip to content

Commit 2d50bc7

Browse files
author
Eric Villa
committed
chore: fixed in-app AWS Identity Center integration login
1 parent 8b35897 commit 2d50bc7

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

packages/desktop-app/src/app/services/app-verification-window.service.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ import {
88
import { IAwsSsoOidcVerificationWindowService } from "@noovolari/leapp-core/interfaces/i-aws-sso-oidc-verification-window-service";
99
import { WindowService } from "./window.service";
1010
import { MessageToasterService, ToastLevel } from "./message-toaster.service";
11+
import { AwsCoreService } from "@noovolari/leapp-core/services/aws-core-service";
1112

1213
@Injectable({ providedIn: "root" })
1314
export class AppVerificationWindowService implements IAwsSsoOidcVerificationWindowService {
14-
constructor(private windowService: WindowService, private toasterService: MessageToasterService) {}
15+
constructor(private windowService: WindowService, private toasterService: MessageToasterService, private awsCoreService: AwsCoreService) {}
1516

1617
async openVerificationWindow(
1718
registerClientResponse: RegisterClientResponse,
@@ -62,7 +63,7 @@ export class AppVerificationWindowService implements IAwsSsoOidcVerificationWind
6263
// When the code is verified and the user has been logged in, the window can be closed
6364
verificationWindow.webContents.session.webRequest.onCompleted(
6465
{
65-
urls: ["https://oidc.eu-west-1.amazonaws.com/device_authorization/associate_token"],
66+
urls: this.getAssociateTokenUrls(),
6667
},
6768
(details, callback) => {
6869
if (details.method === "POST" && details.statusCode === 200) {
@@ -99,6 +100,10 @@ export class AppVerificationWindowService implements IAwsSsoOidcVerificationWind
99100
});
100101
}
101102

103+
private getAssociateTokenUrls() {
104+
return this.awsCoreService.getRegions().map((region) => `https://oidc.${region.region}.amazonaws.com/device_authorization/associate_token`);
105+
}
106+
102107
private async openExternalVerificationBrowserWindow(
103108
registerClientResponse: RegisterClientResponse,
104109
startDeviceAuthorizationResponse: StartDeviceAuthorizationResponse

0 commit comments

Comments
 (0)