Announcement Announcement Module
Collapse
No announcement yet.
Can a user's authorities be specified in a java file Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Can a user's authorities be specified in a java file

    I'm using spring 3.0.Look at the code below

    <authentication-manager alias="authenticationManager">
    <authentication-provider>
    <!--<jdbc-user-service data-source-ref="dataSource"/>-->
    <password-encoder hash="md5"/>
    <user-service>
    <user name="presales" password="5d7bef99362b26cdc709f6ab436eedb2" authorities="ROLE_USER,ROLE_ADMIN" />

    </user-service>
    </authentication-provider>
    </authentication-manager>

    I have to load the authorities(say ROLE_USER) from a java file. Is there anyway to implement this?Can any one help me?

  • #2
    You can define your java class containing the roles as a spring bean and use SpEL to inject the roles. If it works let us know!

    Comment


    • #3
      Originally posted by marcovmx View Post
      You can define your java class containing the roles as a spring bean and use SpEL to inject the roles. If it works let us know!
      Thank you. can you give me an example?

      Comment

      Working...
      X