Results 1 to 10 of 10

Thread: Externalizing client id in sparklr

  1. #1

    Post Externalizing client id in sparklr

    Hi,

    I would like to externalize the client id instead of declaring them in the xml in sparklr application. As a solution, I tried reading them from property files as below:

    <oauth:client clientId="${my.client.id.property.file}" secret="${my.client.secret.property.file}" authorizedGrantTypes="${my.client.flows.property.f ile}" scope="${my.client.scope.property.file} authorities="${my.client.authorities.property.file }"/>


    But this again again limits my requirement . I can read only the client ids that are declared in the property file.

    My requirement is in such a way that the client id should be read from the database as there is change of increase in the number of clients for my application. Is there any way to do this.

    Thanks in advance,
    Venkat

  2. #2
    Join Date
    May 2008
    Location
    Salt Lake City
    Posts
    167

    Default

    Implement your own instance of org.springframework.security.oauth.provider.Consum erDetailsService and wire it in to the oauth mechanism.

  3. #3
    Join Date
    Aug 2011
    Posts
    7

    Default

    I ask, how to configure this service?
    When configure "oauth: client-details-service", prompt "cvc-complex-type.3.2.2: Attribute 'class' is not allowed to appear in element 'oauth: client-details-service'."
    Such as:
    <oauth:client-details-service id="myClientDetails" class="test.MyClientDetails">
    </ oauth: client-details-service>
    Last edited by yes_is_me; Aug 17th, 2011 at 10:26 PM.

  4. #4
    Join Date
    Jun 2005
    Posts
    4,232

    Default

    Try a bean definition
    Code:
    <bean id="myClientDetails" class="test.MyClientDetails"/>

  5. #5
    Join Date
    Aug 2011
    Posts
    7

    Default

    Thanks Dave Syer reply
    <oauthrovider client-details-service-ref="myClientDetails" token-services-ref="tokenServices">
    <oauth:verification-code user-approval-page="/oauth/confirm_access"/>
    </ oauth: provider>

    <beans:bean id="myClientDetails" class="test.MyClientDetails">
    </ beans: bean>
    This configuration, there is no access to "myClientDetails" the bean.
    Still enter InMemoryClientDetailsService.

  6. #6
    Join Date
    Jun 2005
    Posts
    4,232

    Default

    Sorry, you lost me. MyClientDetails is an implementation of ClientDetailsService? What do you mean by "there is no access"?

  7. #7
    Join Date
    Aug 2011
    Posts
    7

    Default

    I'm so sorry! I english is bad.
    yes,it is. MyClientDetails is an implementation of ClientDetailsService.
    But do not use this service MyClientDetails.

  8. #8
    Join Date
    Jun 2005
    Posts
    4,232

    Default

    So you think your service is being ignored? Is another being used instead (hard to believe since the client details will be needed to actually grant a token to some client)? Can you please be a bit more detailed and specific about what is happening or not happening?

  9. #9
    Join Date
    Aug 2011
    Posts
    7

    Default

    As venkatkasagani as described, I want to store the client information in the database. I achieve the "ClientDetailsService" interface. Configuration is as follows:
    <oauthrovider client-details-service-ref="myClientDetails" token-services-ref="tokenServices">
    <oauth:verification-code user-approval-page="/oauth/confirm_access"/>
    </ Oauth: provider>
    <beans:bean id="myClientDetails" class="test.MyClientDetails">
    </ Beans: bean>
    Now it seems this configuration does not play any role, client information is still using the default implementation of the management.

  10. #10
    Join Date
    Aug 2011
    Posts
    7

    Default

    Problem was solved.
    Configuration is as follows:
    <oauthrovider client-details-service-ref="clientDetails" token-services-ref="tokenServices">
    <oauth:verification-code user-approval-page="/oauth/confirm_access"/>
    </ Oauth: provider>
    <beans:bean id="clientDetails" class="test.MyClientDetails">
    </ Beans: bean>
    Note the red part of the.

Posting Permissions

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