-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
49d838f
commit 73d5ecc
Showing
4 changed files
with
101 additions
and
14 deletions.
There are no files selected for viewing
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
42 changes: 42 additions & 0 deletions
42
packages/cli/src/sso/saml/views/samlConnectionTestFailed.ts
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,42 @@ | ||
import { SamlUserAttributes } from '../types/samlUserAttributes'; | ||
|
||
export function getSamlConnectionTestFailedView( | ||
message: string, | ||
attributes?: SamlUserAttributes, | ||
): string { | ||
return ` | ||
<http> | ||
<head> | ||
<title>n8n - SAML Connection Test Result</title> | ||
<style> | ||
body { background: rgb(251,252,254); font-family: 'Open Sans', sans-serif; padding: 10px; margin: auto; width: 500px; top: 40%; position: relative; } | ||
h1 { color: rgb(240, 60, 60); font-size: 16px; font-weight: 400; margin: 0 0 10px 0; } | ||
h2 { color: rgb(0, 0, 0); font-size: 12px; font-weight: 400; margin: 0 0 10px 0; } | ||
button { border: 1px solid rgb(219, 223, 231); background: rgb(255, 255, 255); border-radius: 4px; padding: 10px; } | ||
ul { border: 1px solid rgb(219, 223, 231); border-radius: 4px; padding: 10px; } | ||
li { decoration: none; list-style: none; margin: 0 0 0px 0; color: rgb(125, 125, 125); font-size: 12px;} | ||
</style> | ||
</head> | ||
<body> | ||
<div style="text-align:center"> | ||
<h1>SAML Connection Test failed</h1> | ||
<h2>${message ?? 'A common issue could be that no email attribute is set'}</h2> | ||
<button onclick="window.close()">You can close this window now</button> | ||
<p></p> | ||
${ | ||
attributes | ||
? ` | ||
<h2>Here are the attributes returned by your SAML IdP:</h2> | ||
<ul> | ||
<li><strong>Email:</strong> ${attributes?.email ?? '(n/a)'}</li> | ||
<li><strong>First Name:</strong> ${attributes?.firstName ?? '(n/a)'}</li> | ||
<li><strong>Last Name:</strong> ${attributes?.lastName ?? '(n/a)'}</li> | ||
<li><strong>UPN:</strong> ${attributes?.userPrincipalName ?? '(n/a)'}</li> | ||
</ul>` | ||
: '' | ||
} | ||
</div> | ||
</body> | ||
</http> | ||
`; | ||
} |
33 changes: 33 additions & 0 deletions
33
packages/cli/src/sso/saml/views/samlConnectionTestSuccess.ts
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,33 @@ | ||
import { SamlUserAttributes } from '../types/samlUserAttributes'; | ||
|
||
export function getSamlConnectionTestSuccessView(attributes: SamlUserAttributes): string { | ||
return ` | ||
<http> | ||
<head> | ||
<title>n8n - SAML Connection Test Result</title> | ||
<style> | ||
body { background: rgb(251,252,254); font-family: 'Open Sans', sans-serif; padding: 10px; margin: auto; width: 500px; top: 40%; position: relative; } | ||
h1 { color: rgb(0, 0, 0); font-size: 16px; font-weight: 400; margin: 0 0 10px 0; } | ||
h2 { color: rgb(0, 0, 0); font-size: 12px; font-weight: 400; margin: 0 0 10px 0; } | ||
button { border: 1px solid rgb(219, 223, 231); background: rgb(255, 255, 255); border-radius: 4px; padding: 10px; } | ||
ul { border: 1px solid rgb(219, 223, 231); border-radius: 4px; padding: 10px; } | ||
li { decoration: none; list-style: none; margin: 0 0 0px 0; color: rgb(125, 125, 125); font-size: 12px;} | ||
</style> | ||
</head> | ||
<body> | ||
<div style="text-align:center"> | ||
<h1>SAML Connection Test was successful</h1> | ||
<button onclick="window.close()">You can close this window now</button> | ||
<p></p> | ||
<h2>Here are the attributes returned by your SAML IdP:</h2> | ||
<ul> | ||
<li><strong>Email:</strong> ${attributes.email ?? '(n/a)'}</li> | ||
<li><strong>First Name:</strong> ${attributes.firstName ?? '(n/a)'}</li> | ||
<li><strong>Last Name:</strong> ${attributes.lastName ?? '(n/a)'}</li> | ||
<li><strong>UPN:</strong> ${attributes.userPrincipalName ?? '(n/a)'}</li> | ||
</ul> | ||
</div> | ||
</body> | ||
</http> | ||
`; | ||
} |