Code Monkey home page Code Monkey logo

Comments (3)

spring-projects-issues avatar spring-projects-issues commented on May 16, 2024

GWA said:

It's true this is a little odd compare to all other authentication provider I know

Anyway, in the SAMLAuthenticationProvider there's a comment on the getPrincipal method that insist that the method can be override

In your project you can declare a provider like this one instead of the vanilla SAMLAuthenticationProvider. This will do exactly what you need.

public class PersonalSamlAuthenticationProvider extends SAMLAuthenticationProvider{

/**
 * 
 * @param consumer
 */
public PersonalSamlAuthenticationProvider(WebSSOProfileConsumer consumer) {
    super(consumer);
}

/* (non-Javadoc)
 * @see org.springframework.security.saml.SAMLAuthenticationProvider#getPrincipal(org.springframework.security.saml.SAMLCredential, java.lang.Object)
 */
@Override
protected Object getPrincipal(SAMLCredential credential, Object userDetail) {
    if (userDetail!=null){
        return userDetail;
    }
    return super.getPrincipal(credential, userDetail);
}

}

from spring-security-saml.

spring-projects-issues avatar spring-projects-issues commented on May 16, 2024

Mandus Elfving said:

I am aware that you can always override the authentication provider, but it seems a bit odd that the SAML extension behaves in a way that isn't consistent with the other authentication methods.Therefore I think it should be considered to change the SAML extension to behave as the others do.

from spring-security-saml.

spring-projects-issues avatar spring-projects-issues commented on May 16, 2024

Vladimir Schäfer said:

Behavior of principal field is now identical to AbstractUserDetailsAuthenticationProvider. By default userDetail object is now put to the principal field of the Authentication object. Previous behavior can be enabled by setting property forcePrincipalAsString to true on the SAMLAuthenticationProvider.

from spring-security-saml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.