goauthentik / authentik

The authentication glue you need.
https://goauthentik.io
Other
13.12k stars 874 forks source link

Jenkins SAML - cannot find entity SPSSODescriptor in metadata provider #3707

Open nickjmv opened 2 years ago

nickjmv commented 2 years ago

Describe your question I have the current config for my SAML provider in Authentik:

I have not configured the NameID Property Mapping to any value.

Then on the Jenkins side, I have defined the following in ConfigurationAsCode:

saml:
  binding: urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST
  emailAttributeName: email
  idpMetadataConfiguration:
    period: 0
    xml: one_line_string_from_authentik_metadata_box
  maximumAuthenticationLifetime: 1296000
  usernameCaseConversion: none

And after deploying this, I get the error:

I hope anyone can help me troubleshoot this further.. Thanks in advance!

Logs

2022-09-30 09:12:49.132+0000 [id=45992] WARNING o.e.j.s.h.ContextHandler$Context#log: Error while serving https://jenkinsplay.internal.mobilevikings.be/securityRealm/commenceLogin
org.pac4j.saml.exceptions.SAMLException: Cannot find entity org.pac4j.saml.metadata.SAML2ServiceProviderMetadataResolver@62fdadd7 or role {urn:oasis:names:tc:SAML:2.0:metadata}SPSSODescriptor in metadata provider
        at org.pac4j.saml.context.SAML2ContextProvider.addContext(SAML2ContextProvider.java:132)
        at org.pac4j.saml.context.SAML2ContextProvider.addSPContext(SAML2ContextProvider.java:105)
        at org.pac4j.saml.context.SAML2ContextProvider.buildServiceProviderContext(SAML2ContextProvider.java:68)
        at org.pac4j.saml.context.SAML2ContextProvider.buildContext(SAML2ContextProvider.java:74)
        at org.pac4j.saml.redirect.SAML2RedirectActionBuilder.redirect(SAML2RedirectActionBuilder.java:37)
        at org.pac4j.core.client.IndirectClient.getRedirectAction(IndirectClient.java:109)
        at org.jenkinsci.plugins.saml.SamlRedirectActionWrapper.process(SamlRedirectActionWrapper.java:47)
        at org.jenkinsci.plugins.saml.SamlRedirectActionWrapper.process(SamlRedirectActionWrapper.java:30)
        at org.jenkinsci.plugins.saml.OpenSAMLWrapper.get(OpenSAMLWrapper.java:67)
        at org.jenkinsci.plugins.saml.SamlSecurityRealm.doCommenceLogin(SamlSecurityRealm.java:261)
        at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:710)
        at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:397)

Version and Deployment (please complete the following information):

BeryJu commented 6 months ago

While I can't help with this issue directly we do have a documented integration guide for Jenkins using OIDC: https://docs.goauthentik.io/integrations/services/jenkins/