PDA

View Full Version : Using an another client API with Spring Security OAuth2 server side



sylvek
Nov 16th, 2010, 02:19 AM
Hello,

I added OAuth2 support on my website. It seem to work properly and now, i want to write a sample in java that ask access_token and calls my protected API.
For that i used this library : http://bitbucket.org/smartproject/oauth-2.0/wiki/Client

But I don't understand what uri i need to call to have a registrar code and after a granted access_token.

private static final String REDIRECT = "http://localhost:8080/sample/oauth/confirm_access.html?response_type=code"; // i see that response_type=token was not available

private static final String AUTHORIZE = "http://localhost:8080/sample/oauth/user/authorize";

private static final String ACCESS_TOKEN = "http://localhost:8080/sample/oauth/authorize";

private static final String CIENT_ID = "sample_client";

Thks for your work!

sylvek
Nov 16th, 2010, 10:29 AM
the answer ;-)

private static final String REDIRECT = "http://localhost:8080/sample";

private static final String AUTHORIZE = "http://localhost:8080/sample/oauth/confirm_access.html?response_type=code";

private static final String ACCESS_TOKEN = "http://localhost:8080/sample/oauth/authorize?response_type=code";

private static final String CIENT_ID = "sample_client";

it's working properly :-) btw, is there an implementation of response_type=token !?

stoicflame
Nov 16th, 2010, 05:45 PM
btw, is there an implementation of response_type=token !?

Not yet, but you're welcome to contribute a patch and/or sponsor the feature if you need it.

sylvek
Nov 18th, 2010, 04:20 PM
if i can do it .. :-)