Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SLO Request Failed In Azure #929

Closed
ehabAbdelMawla opened this issue Aug 15, 2024 · 1 comment
Closed

SLO Request Failed In Azure #929

ehabAbdelMawla opened this issue Aug 15, 2024 · 1 comment
Labels

Comments

@ehabAbdelMawla
Copy link

I have a MultiSamlStrategy implementation with saml factory

	GetSamlConfiguration(config, accountKey, clientRedirectUrl) {
		return {
			entryPoint: config.SamlEntryPointUrl,
			signatureAlgorithm: 'sha256' as SignatureAlgorithm,
			issuer: config.SamlIssuer,
			idpCert: config.SamlCertificate,
			callbackUrl: this.GetCallBackUrl(accountKey, clientRedirectUrl),
			wantAssertionsSigned: true,
			wantAuthnResponseSigned: false
		};
	}
	onModuleInit() {
		passport.use(
			new MultiSamlStrategy(
				{
					passReqToCallback: true,
					getSamlOptions: async (req: any, Done) => {
						try {
							const { accountKey, clientRedirectUrl } = req.query;
							console.log('getSamlOptions', { accountKey, clientRedirectUrl });
							const config = await this.GenericRepository.GetAccountSsoConfigByKey(accountKey);
							if (!(config && config.SsoType == SsoTypes.SAML)) {
								throw new SsoException(ErrorCodesEnum.SSO_CONFIGURATION_NOT_FOUND);
							}
							return Done(null, this.GetSamlConfiguration(config, accountKey, clientRedirectUrl));
						} catch (error) {
							return Done(new SsoException(ErrorCodesEnum.SSO_CONFIGURATION_NOT_FOUND), null);
						}
					}
				},
				function (Req, Profile, Done) {
					return Done(null, {
						email: Profile.nameID
					});
				},
				null
			)
		);
	}

	logout(req: any, res: any) {
		(passport as any)._strategy('saml').logout(req, function (err, logoutUrl) {
			if (err) {
				console.log({ err });
				return res.status(500).send('Error during logout');
			}

			console.log({ logoutUrl });
			return res.redirect(logoutUrl);
		});
	}

but i get following error in Microsoft
AADSTS7500525: There was an XML error in the SAML message at line 1, position 445. Verify that the XML content of the SAML messages conforms to the SAML protocol specifications.

@ehabAbdelMawla
Copy link
Author

image

@node-saml node-saml locked and limited conversation to collaborators Aug 15, 2024
@markstos markstos converted this issue into discussion #930 Aug 15, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

1 participant