@@ -14,29 +14,36 @@ export class KombitStrategy extends PassportStrategy(SamlStrategy, "kombit") {
1414 constructor ( private readonly authService : AuthService ) {
1515 super (
1616 {
17- issuer : `${ configuration ( ) [ "backend" ] [ "baseurl" ] } /api/v1/auth/kombit/metadata` ,
1817 callbackUrl : `${ configuration ( ) [ "backend" ] [ "baseurl" ] } /api/v1/auth/kombit/login/callback` ,
19- publicCert : configuration ( ) [ "kombit" ] [ "certificatePublicKey" ] ,
20- idpCert : configuration ( ) [ "kombit" ] [ "certificatePublicKey" ] ,
21- audience : `${ configuration ( ) [ "backend" ] [ "baseurl" ] } /api/v1/auth/kombit/metadata` ,
22- logoutCallbackUrl : `${ configuration ( ) [ "backend" ] [ "baseurl" ] } /api/v1/auth/kombit/logout/callback` ,
23- logoutUrl : configuration ( ) [ "kombit" ] [ "entryPoint" ] ,
2418 entryPoint : configuration ( ) [ "kombit" ] [ "entryPoint" ] ,
25- identifierFormat : "" ,
19+ issuer : `${ configuration ( ) [ "backend" ] [ "baseurl" ] } /api/v1/auth/kombit/metadata` ,
20+ audience : `${ configuration ( ) [ "backend" ] [ "baseurl" ] } /api/v1/auth/kombit/metadata` ,
21+ idpCert : configuration ( ) [ "kombit" ] [ "certificatePublicKey" ] ,
22+ privateKey : configuration ( ) [ "kombit" ] [ "certificatePrivateKey" ] ,
23+ publicCert : configuration ( ) [ "kombit" ] [ "certificateOwnPublicKey" ] ,
2624 decryptionPvk : configuration ( ) [ "kombit" ] [ "certificatePrivateKey" ] ,
2725 signatureAlgorithm : "sha256" ,
26+ logoutCallbackUrl : `${ configuration ( ) [ "backend" ] [ "baseurl" ] } /api/v1/auth/kombit/logout/callback` ,
27+ logoutUrl : configuration ( ) [ "kombit" ] [ "entryPoint" ] ,
28+ acceptedClockSkewMs : 1000 , // Allow some slack in clock sync
2829 disableRequestedAuthnContext : true ,
30+ wantAuthnResponseSigned : false ,
31+ identifierFormat : "" ,
2932 authnRequestBinding : "HTTP-Redirect" ,
30- acceptedClockSkewMs : 1000 , // Allow some slack in clock sync
3133 } ,
32- ( req , profile , done ) => {
34+ function ( profile : Profile , done : Function ) {
3335 return this . validate ( profile , done ) ;
3436 }
3537 ) ;
3638 }
3739
3840 // eslint-disable-next-line @typescript-eslint/ban-types
39- async validate ( profile : Profile , done : Function ) : Promise < UserResponseDto > {
41+ public async validate ( profile : Profile , done : Function ) : Promise < UserResponseDto > {
42+ this . logger . log ( "Profile" , profile ) ;
43+ const samlResponse = profile . getSamlResponseXml ( ) ;
44+ this . logger . log ( "SAML Response" , samlResponse ) ;
45+ this . logger . log ( "AssertionXML" , profile . getAssertionXml ( ) ) ;
46+
4047 try {
4148 const exists = await this . authService . validateKombitUser ( profile ) ;
4249 done ( null , exists ) ;
0 commit comments