Skip to content

misunderstanding in enviroment  #3

@nvh1307

Description

@nvh1307

Sorry, I have clone your repository to learn because I also have to implement keycloak into NextJS (using SAML protocol). I can run your project, but when I click button login, it redirected me to keycloak but it's the page not found. So I think I missing a step?.
I think the problem in enviroment in this code below

export const idp = samlify.IdentityProvider({
	metadata: Buffer.from(process.env.IDP_METADATA as string, 'base64'),
});

export const sp = samlify.ServiceProvider({
	entityID: process.env.SP_IDENTITY,
	authnRequestsSigned: true,
	wantMessageSigned: true,
	wantLogoutResponseSigned: true,
	wantLogoutRequestSigned: true,
	wantAssertionsSigned: true,
	signingCert: Buffer.from(process.env.SIGN_B64_CERTIFICATE as string, 'base64'),
	privateKey: Buffer.from(process.env.SIGN_B64_PRIVATE_KEY as string, 'base64'),
	privateKeyPass: process.env.SP_PRIVATE_KEY_PASS,
	assertionConsumerService: [
		{
			Binding: samlify.Constants.namespace.binding.post,
			Location: process.env.SSO_CALLBACK_URL as string,
		},
	],
});

I don't know how to get base64 certificate and private key, private key pass ( sorry but all of this enviroment above =))) I researched but it have many source but none of them give me a solution, that's poor )
So could you tell me where you get private key, certificate also metadata in keycloak.
By the way, I was struggling to find a good tutorial on this, but your approach is actually well thought out. It's very nice and very helpful

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions