-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
authenticationUrl fix (KEY-343) (#40)
* authenticationUrl fix + tests * linting
- Loading branch information
1 parent
b8d2215
commit 70a924c
Showing
10 changed files
with
53 additions
and
15 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* eslint-disable import/no-extraneous-dependencies */ | ||
import { expect } from 'chai'; | ||
import { setProvider } from '../../../server/lib/config'; | ||
import authenticationUrl from '../../../server/lib/authenticationUrl'; | ||
|
||
describe('authenticationUrl', () => { | ||
setProvider(() => 'auth0.example.com'); | ||
|
||
it('should return saml url with connection', () => { | ||
const app = { | ||
type: 'saml', | ||
scope: 'scope', | ||
client: 'client', | ||
callback: 'callback', | ||
connection: 'connection', | ||
response_type: 'response_type' | ||
}; | ||
|
||
expect(authenticationUrl(app)).to.equal('https://auth0.example.com/samlp/client?connection=connection'); | ||
}); | ||
|
||
it('should return wsfed url with connection', () => { | ||
const app = { | ||
type: 'wsfed', | ||
scope: 'scope', | ||
client: 'client', | ||
callback: 'callback', | ||
connection: 'connection', | ||
response_type: 'response_type' | ||
}; | ||
|
||
expect(authenticationUrl(app)).to.equal('https://auth0.example.com/wsfed/client?wreply=callback&whr=connection'); | ||
}); | ||
|
||
it('should return oidc url with connection', () => { | ||
const app = { | ||
type: 'oidc', | ||
scope: 'scope', | ||
client: 'client', | ||
callback: 'callback', | ||
connection: 'connection', | ||
response_type: 'response_type' | ||
}; | ||
|
||
expect(authenticationUrl(app)).to.equal('https://auth0.example.com/authorize?response_type=response_type&scope=scope&client_id=client&redirect_uri=callback&connection=connection'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters