Announcement Announcement Module
Collapse
No announcement yet.
Externalizing client id in sparklr Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    Implement your own instance of org.springframework.security.oauth.provider.Consum erDetailsService and wire it in to the oauth mechanism.

    Comment


    • #3
      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, 11:26 PM.

      Comment


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

        Comment


        • #5
          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.

          Comment


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

            Comment


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

              Comment


              • #8
                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?

                Comment


                • #9
                  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.

                  Comment


                  • #10
                    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.

                    Comment

                    Working...
                    X