Announcement Announcement Module
Collapse
No announcement yet.
write client with oauth2 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • write client with oauth2

    I download sparklr and tonr app M6 and was able to connect with tonr to sparklr and then i tried https://code.google.com/oauthplayground/
    and ilogin gand authorized and it failed i get the code but the token not created
    Authorization endpoint:http://localhost:8080/sparklr2/oauth/authorize
    Token endpoint:http://localhost:8080/sparklr2/oauth/token
    OAuth Client ID:tonr
    OAuth Client secret:secret
    what am i Missing here ?

  • #2
    Maybe you could describe in a bit more detail what you did, and what the purpose of the google link you posted is? I don't immediately see a connection with sparklr2.

    Comment


    • #3
      The google link is oauth2 web client for test.
      I want write spring mvc project with oauth like sparklr and web client to get info from the app, start by set up sparklr and tonr next i try the link to Study how to call aouth2 from web but when i use the link it failed to get the token.

      Comment


      • #4
        Isn't the google link a client app for testing Google API resources, and learning about the exchange of codes and tokens specifically in their system? It should obtain a Google access token for you if you have a Google account. I don't see how it is relevant to sparklr2.

        Comment


        • #5
          The google link is also for testing 3rd party OAuth 2.0 apps . You can see configure other parties by clicking on the Settings icon on the top right.

          This link also explains that it can be used by 3rd party:
          http://www.readwriteweb.com/hack/201...eadWriteWeb%29 .

          I got it to work with sparklr2: i can login and get authorized (code is created) but the token isn't. I am not sure what is wrong. Can you help me? Do you need any other info from me?

          A side note, I could not find any other simple tools to work with server side OAuth 2.0. This looks like a great way. Do you have alternative suggestions? If not, I recommend to let others know about it as well.

          Comment


          • #6
            Yes, the tool looks like it might be quite nice for learning about OAuth2. But no point publicising it yet if it doesn't work. Where did you deploy sparklr2? It isn't going to work if you use localhost, is it, because the client app needs to be able to contact the token endpoint?

            I tried it with a cloudfoundry deployment and it breaks with a 401 on the token endpoint anyway, because it is not sending the client credentials in the right form (in the header). So the Google client app is broken I would say. I think sparklr2 has the clientCredentialsTokenEndpointFilter defined in it's application context, but not in web.xml - if you add the filter to web.xml it might work.

            Comment


            • #7
              I deploy sparklr2 on my computer with localhost i will try to call it from another computer and see what happend .
              what filter to add the xml?

              Comment


              • #8
                OK, I deployed sparklr2 from s2-oauth master, with the addition of the client request token filter. It's here: http://dsyersparklr2.cloudfoundry.com/, and it works fine with the Google playground app.

                Comment


                • #9
                  I added this to my web.xml:

                  Code:
                  	<filter>
                  		<filter-name>clientCredentialsTokenEndpointFilter</filter-name>
                  		<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
                  		<init-param>
                  			<param-name>contextAttribute</param-name>
                  			<param-value>org.springframework.web.servlet.FrameworkServlet.CONTEXT.spring</param-value>
                  		</init-param>
                  	</filter>
                  
                  	<filter-mapping>
                  		<filter-name>clientCredentialsTokenEndpointFilter</filter-name>
                  		<url-pattern>/oauth/token</url-pattern>
                  	</filter-mapping>

                  Comment


                  • #10
                    thanks it work.

                    Comment

                    Working...
                    X