Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
migrate to new sts url (#192)
Browse files Browse the repository at this point in the history
Co-authored-by: Shayde Nofziger <Shayde.Nofziger@blackbaud.me>
  • Loading branch information
ShaydeNofziger and Shayde Nofziger authored Apr 22, 2021
1 parent cd7c87c commit 6e0a0af
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/auth/auth-cross-domain-iframe.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {

describe('Auth Cross Domain Iframe', () => {
// URL to get IFrame
const URL = 'https://s21aidntoken00blkbapp01.nxt.blackbaud.com/Iframes/CrossDomainAuthFrame.html';
const URL = 'https://sts.sky.blackbaud.com/Iframes/CrossDomainAuthFrame.html';

let fakeIframe: HTMLIFrameElement;

Expand Down
4 changes: 2 additions & 2 deletions src/auth/auth-cross-domain-iframe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {

//#endregion

const URL = 'https://s21aidntoken00blkbapp01.nxt.blackbaud.com/Iframes/CrossDomainAuthFrame.html'; // URL to get IFrame
const URL = 'https://sts.sky.blackbaud.com/Iframes/CrossDomainAuthFrame.html'; // URL to get IFrame
const HOST = 'security-token-svc';
const SOURCE = 'auth-client';

Expand All @@ -41,7 +41,7 @@ export class BBAuthCrossDomainIframe {
public static tokenRequests: any = {};
public static requestCounter = 0;

private static TARGETORIGIN = 'https://s21aidntoken00blkbapp01.nxt.blackbaud.com';
private static TARGETORIGIN = 'https://sts.sky.blackbaud.com';

public static reset() {
this.requestCounter = 0;
Expand Down
8 changes: 4 additions & 4 deletions src/auth/auth-domain.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ describe('Auth Get Domain', () => {
expect(BBAuthDomain.getSTSDomain()).toBe('https://sts-sso.bbk12.com');
});

it('returns S21 STS Url when user is on a Blackbaud domain', () => {
it('returns default STS Url when user is on a Blackbaud domain', () => {
BBAuthDomain.CURRENT_DOMAIN = 'blackbaud.com';
expect(BBAuthDomain.getSTSDomain()).toBe('https://s21aidntoken00blkbapp01.nxt.blackbaud.com');
expect(BBAuthDomain.getSTSDomain()).toBe('https://sts.sky.blackbaud.com');
});

// tslint:disable-next-line:max-line-length
it('returns S21 STS Url when user is on a registered third party domain which has NOT declared a CNAME STS endpoint', () => {
it('returns default STS Url when user is on a registered third party domain which has NOT declared a CNAME STS endpoint', () => {
BBAuthDomain.CURRENT_DOMAIN = 'unregisteredthirdparty.com';
expect(BBAuthDomain.getSTSDomain()).toBe('https://s21aidntoken00blkbapp01.nxt.blackbaud.com');
expect(BBAuthDomain.getSTSDomain()).toBe('https://sts.sky.blackbaud.com');
});

// tslint:disable-next-line:max-line-length
Expand Down
2 changes: 1 addition & 1 deletion src/auth/auth-domain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const thirdPartyDomainSTSUrlMappings: { [domain: string]: string; } = {
'smartaidforparents.com': 'https://account.smartaidforparents.com',
'smarttuition.com': 'https://account.smarttuition.com'
};
const defaultSTSUrl = 'https://s21aidntoken00blkbapp01.nxt.blackbaud.com';
const defaultSTSUrl = 'https://sts.sky.blackbaud.com';

export class BBAuthDomain {

Expand Down
8 changes: 4 additions & 4 deletions src/auth/auth-token-integration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ describe('Auth token integration', () => {
beforeEach(() => {
requestSpy = spyOn(BBCsrfXhr, 'request');
spyOn(BBAuthDomain, 'getRegisteredDomain').and.returnValue(undefined);
spyOn(BBAuthDomain, 'getSTSDomain').and.returnValue('https://s21aidntoken00blkbapp01.nxt.blackbaud.com');
spyOn(BBAuthDomain, 'getSTSDomain').and.returnValue('https://sts.sky.blackbaud.com');
spyOn(BBAuthTokenIntegration, 'getLocationHostname').and.returnValue('blackbaud.com');
});

it('should request a token without params', () => {
BBAuthTokenIntegration.getToken();

expect(requestSpy).toHaveBeenCalledWith(
'https://s21aidntoken00blkbapp01.nxt.blackbaud.com/oauth2/token',
'https://sts.sky.blackbaud.com/oauth2/token',
undefined,
undefined,
undefined,
Expand All @@ -50,7 +50,7 @@ describe('Auth token integration', () => {
BBAuthTokenIntegration.getToken(true, 'abc', '123');

expect(requestSpy).toHaveBeenCalledWith(
'https://s21aidntoken00blkbapp01.nxt.blackbaud.com/oauth2/token',
'https://sts.sky.blackbaud.com/oauth2/token',
undefined,
true,
'abc',
Expand All @@ -65,7 +65,7 @@ describe('Auth token integration', () => {
BBAuthTokenIntegration.getToken(true, 'abc', '123', 'xyz');

expect(requestSpy).toHaveBeenCalledWith(
'https://s21aidntoken00blkbapp01.nxt.blackbaud.com/oauth2/token',
'https://sts.sky.blackbaud.com/oauth2/token',
undefined,
true,
'abc',
Expand Down
4 changes: 2 additions & 2 deletions src/omnibar/omnibar-user-activity.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ describe('Omnibar user activity', () => {
});

myDomain = spyOn(BBAuthDomain, 'getSTSDomain').and
.returnValue('https://s21aidntoken00blkbapp01.nxt.blackbaud.com');
.returnValue('https://sts.sky.blackbaud.com');

requestSpy = spyOn(BBCsrfXhr, 'request').and.callFake((url: string) => {
switch (url.substr('https://s21aidntoken00blkbapp01.nxt.blackbaud.com/session/'.length)) {
switch (url.substr('https://sts.sky.blackbaud.com/session/'.length)) {
case 'renew':
renewWasCalled = true;
break;
Expand Down
6 changes: 3 additions & 3 deletions src/omnibar/omnibar-user-session-expiration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ describe('Omnibar user session expiration', () => {

beforeAll(() => {
domainSpy = spyOn(BBAuthDomain, 'getSTSDomain').and
.returnValue('https://s21aidntoken00blkbapp01.nxt.blackbaud.com');
.returnValue('https://sts.sky.blackbaud.com');

requestSpy = spyOn(BBCsrfXhr, 'request').and.callFake((url: string) => {
switch (url.substr('https://s21aidntoken00blkbapp01.nxt.blackbaud.com/session/'.length)) {
switch (url.substr('https://sts.sky.blackbaud.com/session/'.length)) {
case 'ttl':
return ttlPromiseOverride || Promise.resolve(authTtl);
}
Expand Down Expand Up @@ -43,7 +43,7 @@ describe('Omnibar user session expiration', () => {
.then((expirationDate) => {
expect(expirationDate).toBeNull();
expect(requestSpy).toHaveBeenCalledWith(
'https://s21aidntoken00blkbapp01.nxt.blackbaud.com/session/ttl',
'https://sts.sky.blackbaud.com/session/ttl',
undefined,
false
);
Expand Down

0 comments on commit 6e0a0af

Please sign in to comment.