Results 1 to 3 of 3

Thread: Can a user's authorities be specified in a java file

  1. #1
    Join Date
    May 2012
    Posts
    2

    Default 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. #2
    Join Date
    Aug 2011
    Location
    Mexico City / Atlanta GA
    Posts
    30

    Default

    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!

  3. #3
    Join Date
    May 2012
    Posts
    2

    Default

    Quote 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?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •