Skip to content
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

Server error #2

Open
kuhlaid opened this issue Nov 5, 2021 · 4 comments
Open

Server error #2

kuhlaid opened this issue Nov 5, 2021 · 4 comments

Comments

@kuhlaid
Copy link

kuhlaid commented Nov 5, 2021

I have tried running this app on Vercel (https://next-auth-saml-iqn2l1q14-kuhlaid.vercel.app) and locally and have the same problem with the login button sending me to /api/auth/login/saml with a 500 error. I'm guessing this app is still in the development stage.

@alipetarian
Copy link

I have this app running locally with me and I had to make some tweaks. The certificate file names needs to be updated.

export const serviceProvider = new ServiceProvider({ entity_id: "saml-poc", private_key: fs.readFileSync("certs/key.pem").toString(), certificate: fs.readFileSync("certs/cert.pem").toString(), assert_endpoint: "http://localhost:3000/api/auth/signin/saml", allow_unencrypted_assertion: true, });

`
export const identityProvider = new IdentityProvider({
sso_login_url: "http://localhost:8080/simplesaml/saml2/idp/SSOService.php",
certificates: [
fs.readFileSync("certs/idp_key.pem").toString(),
],
});

`

image
I generated a certificate and duplicated that and kept these names. Its working for me locally.

I am not sure if you can run this on vercel or not. I assume, you can not as it needs docker stuff.

@User13091994
Copy link

I have been trying to integrate this code with OKTA SSO will it work instead of the SimplePHPSSO?

@User13091994
Copy link

I have been trying to, but it always reaches the login page again and never calls the callback URL.

@kronos5807
Copy link

@User13091994 I encountered the same issue today and was led to a solution here on this Github Issue (Clever/saml2#136).

In your Okta SAML settings, you will have specified a value for Audience URI (SP Entity ID). I used http://localhost:3000 in Okta field. You need to make sure that the entity_id parameter inside the saml2-js service provider file has the same value. Replace entity_id: "saml-poc" with the SP Entity ID setup in Okta; in my case entity_id: "http://localhost:3000"

Assuming your problem was the same as mine, this will help. Hope this helps you or someone else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants