-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMPROVE] SAML implementation (#17742)
- Loading branch information
1 parent
6e38936
commit ee85880
Showing
48 changed files
with
4,342 additions
and
1,910 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
app/meteor-accounts-saml/server/definition/IAttributeMapping.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,17 @@ | ||
export interface IAttributeMapping { | ||
fieldName: string | Array<string>; | ||
regex?: string; | ||
template?: string; | ||
} | ||
|
||
export interface IUserDataMap { | ||
customFields: Map<string, IAttributeMapping>; | ||
attributeList: Set<string>; | ||
identifier: { | ||
type: string; | ||
attribute?: string; | ||
}; | ||
email: IAttributeMapping; | ||
username: IAttributeMapping; | ||
name: IAttributeMapping; | ||
} |
10 changes: 10 additions & 0 deletions
10
app/meteor-accounts-saml/server/definition/IAuthorizeRequestVariables.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,10 @@ | ||
export interface IAuthorizeRequestVariables extends Record<string, string> { | ||
newId: string; | ||
instant: string; | ||
callbackUrl: string; | ||
entryPoint: string; | ||
issuer: string; | ||
identifierFormat: string; | ||
authnContextComparison: string; | ||
authnContext: string; | ||
} |
9 changes: 9 additions & 0 deletions
9
app/meteor-accounts-saml/server/definition/ILogoutRequestVariables.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,9 @@ | ||
export interface ILogoutRequestVariables extends Record<string, string> { | ||
newId: string; | ||
instant: string; | ||
idpSLORedirectURL: string; | ||
issuer: string; | ||
identifierFormat: string; | ||
nameID: string; | ||
sessionIndex: string; | ||
} |
5 changes: 5 additions & 0 deletions
5
app/meteor-accounts-saml/server/definition/ILogoutResponse.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,5 @@ | ||
export interface ILogoutResponse { | ||
id: string; | ||
response: string; | ||
inResponseToId: string; | ||
} |
10 changes: 10 additions & 0 deletions
10
app/meteor-accounts-saml/server/definition/ILogoutResponseVariables.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,10 @@ | ||
export interface ILogoutResponseVariables extends Record<string, string> { | ||
newId: string; | ||
instant: string; | ||
idpSLORedirectURL: string; | ||
issuer: string; | ||
identifierFormat: string; | ||
nameID: string; | ||
sessionIndex: string; | ||
inResponseToId: string; | ||
} |
7 changes: 7 additions & 0 deletions
7
app/meteor-accounts-saml/server/definition/IMetadataVariables.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,7 @@ | ||
export interface IMetadataVariables extends Record<string, string> { | ||
issuer: string; | ||
certificate: string; | ||
identifierFormat: string; | ||
callbackUrl: string; | ||
sloLocation: string; | ||
} |
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,5 @@ | ||
export interface ISAMLAction { | ||
actionName: string; | ||
serviceName: string; | ||
credentialToken: string; | ||
} |
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,4 @@ | ||
export interface ISAMLAssertion { | ||
assertion: Element | Document; | ||
xml: string; | ||
} |
11 changes: 11 additions & 0 deletions
11
app/meteor-accounts-saml/server/definition/ISAMLGlobalSettings.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,11 @@ | ||
export interface ISAMLGlobalSettings { | ||
generateUsername: boolean; | ||
nameOverwrite: boolean; | ||
mailOverwrite: boolean; | ||
immutableProperty: string; | ||
defaultUserRole: string; | ||
roleAttributeName: string; | ||
roleAttributeSync: boolean; | ||
userDataFieldMap: string; | ||
usernameNormalize: string; | ||
} |
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,4 @@ | ||
export interface ISAMLRequest { | ||
id: string; | ||
request: string; | ||
} |
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,23 @@ | ||
export interface ISAMLUser { | ||
customFields: Map<string, any>; | ||
emailList: Array<string>; | ||
fullName: string | null; | ||
roles: Array<string>; | ||
eppn: string | null; | ||
|
||
username?: string; | ||
language?: string; | ||
channels?: Array<string>; | ||
samlLogin: { | ||
provider: string | null; | ||
idp: string; | ||
idpSession: string; | ||
nameID: string; | ||
}; | ||
|
||
attributeList: Map<string, any>; | ||
identifier: { | ||
type: string; | ||
attribute?: string; | ||
}; | ||
} |
28 changes: 28 additions & 0 deletions
28
app/meteor-accounts-saml/server/definition/IServiceProviderOptions.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,28 @@ | ||
export interface IServiceProviderOptions { | ||
provider: string; | ||
entryPoint: string; | ||
idpSLORedirectURL: string; | ||
issuer: string; | ||
cert: string; | ||
privateCert: string; | ||
privateKey: string; | ||
customAuthnContext: string; | ||
authnContextComparison: string; | ||
defaultUserRole: string; | ||
roleAttributeName: string; | ||
roleAttributeSync: boolean; | ||
allowedClockDrift: number; | ||
signatureValidationType: string; | ||
identifierFormat: string; | ||
nameIDPolicyTemplate: string; | ||
authnContextTemplate: string; | ||
authRequestTemplate: string; | ||
logoutResponseTemplate: string; | ||
logoutRequestTemplate: string; | ||
metadataCertificateTemplate: string; | ||
metadataTemplate: string; | ||
callbackUrl: string; | ||
|
||
// The id attribute is filled midway through some operations | ||
id?: string; | ||
} |
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,11 @@ | ||
export interface ILogoutRequestValidateCallback { | ||
(err: string | object | null, data?: Record<string, string | null> | null): void; | ||
} | ||
|
||
export interface ILogoutResponseValidateCallback { | ||
(err: string | object | null, inResponseTo?: string | null): void; | ||
} | ||
|
||
export interface IResponseValidateCallback { | ||
(err: string | object | null, profile?: Record<string, any> | null, loggedOut?: boolean): void; | ||
} |
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 |
---|---|---|
@@ -1,2 +1,5 @@ | ||
import './saml_rocketchat'; | ||
import './saml_server'; | ||
import './startup'; | ||
import './loginHandler'; | ||
import './listener'; | ||
import './methods/samlLogout'; | ||
import './methods/addSamlService'; |
Oops, something went wrong.