RSS

OAuth 1.0 Playground with Wso2IS 4.0.0

06 Nov

Following Playground 1.0 application is written for Oauth 1.0
First you have to download the Oauth Playground 1.0 war and deploy on the Apache tomcat server

Then you have to open the playground.war file and go to /WEB-INF/web.xml file
Find WSO2CARBON_URL parameter and replace the parameter value with your absolute path of wso2carbon.jks file.
ex/ You can easily find wso2carbon.jks form $IS_HOME/repository/resources/security/

<init-param>
    <description>Wso2Carbon.jks file location</description>
    <param-name>WSO2CARBON_URL</param-name>
    <param-value>$IS_HOME/repository/resources/security/wso2carbon.jks</param-value>
</init-param>

Once you finish this save the web.xml file.
Now you can verify the application from http://localhost:8080/playground/
Download source code of Playground 1.0

Now you have to start the IS and register the Oauth application as follows go to “Manage -> OAuth”
Oauth version – 1.0
Application Name – playground
Callback Url – http://localhost:8080/playground/oauth/oauth_callback

Click on the registered application you can see the following window with all the details

Now go to application playground http://localhost:8080/playground/ and fill the details
Consumer key, Consumer Secret you can take those form the IS
Scope you can give as a String ex/ echoService

Once you send this you get the oauth_token  and oauth_token_secret

Now you have to send the oauth_token to Authorize

After Authorizing the Token IS will send you the Access_token

Now you can access the resource form the given token

This is a test application so what we are doing is just take the toke and if its is ok then the application will print the Authorized user and the scope in the back end. you can see the following out put in the tomcat server console once you click on the “Access Service”

About these ads
 
3 Comments

Posted by on November 6, 2012 in Identity Server, java, wso2

 

Tags: , , ,

3 responses to “OAuth 1.0 Playground with Wso2IS 4.0.0

  1. Ramith Jayasinghe

    November 28, 2012 at 7:24 pm

    In this playground pom file .. you could improve the hard corded systemPath values ${basedir}
    for example : ${basedir}/src/main/webapp/WEB-INF/lib/org.wso2.carbon.identity.oauth.stub-4.0.3.jar

     
    • malalanayake

      January 10, 2013 at 3:02 pm

      Thanks Ramith. POM file updated with ${project.basedir}

       

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

%d bloggers like this: