---------- Forwarded message ----------
From: Sriragu Arudsothy <[email protected]>
Date: Thu, Jan 24, 2013 at 12:42 PM
Subject: Deployment of REST API developed for G-Reg
To: Nuwan Bandara <[email protected]>, Ruchira Wageesha <[email protected]>
hai..!
the following need to be done before deploy the REST API.
1) Through the UES management console, install the following features.
- Jax web app management feature which is under the Application server
feature.
- Identity OAuth, Token Authenticator features.
2) After installed, restart the server you will see the OAuth,
Jax-WS/Jax-RS under the manage section of the console. now copy the REST
api war file to the /jaxwebapps and restart the server. you will see the
file is get deployed. (No need to add the additional jars - I hope)
3) Now click on OAuth menu, will display UI to register new application.
just give an application name(it may not be the exact name of the REST API,
In OAuth Implementation uses the application name as a key to identify the
the access token according to OAuth 2.0 spec, keep in mind that one
application can have one access token until it expires). for callback url -
just give any URL. bz we don't need this at the moment. click on add.
4) you would see that your application has been registered. Click on it,
will open a application settings panel where you can see the client ID
/client secret / auth endpoint(not needed now), access endpoint.
5) open http://www.base64encode.org/. copy the values of client id, client
secret in the format of cliend id:client secret and click on encode button
to generate the base64 encode value.
6) execute the following curl command from the terminal. If you dont have
curl, install it *sudo apt-get install curl *command.
curl -v -X POST -H "Authorization: Basic *encoded value*" -H "Content-Type:
application/x-www-form-urlencoded;charset=UTF-8" -k -d
"grant_type=password&username=*usernname of the person whose resource is
requested(resource owner username)*&password=*passowrd of the person whose
resource is requested(resource owner password)*"
https://localhost:9443/oauth2endpoints/token
7) replace the *Bold* values with the respective values.
8) after you executed the curl command you would see the access token has
been generated.
9) use the access token with the "Authorization" header to access the
resource.
regards,
Ragu
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev