To
enable OAuth support for your client application, First we need to
register our application on WSO2 Identity Server.
Step to register Client App on WSO2 IS :
- Goto
Management Console and Enter your username and password. By default
its “admin”.
- Click
Main
button and then OAuth
in Manage
menu.
- Click
on the Register
New Application link
on the OAuth
Management
page.
- Select
OAuth
2.0
as the OAuth
Version.
Enter Application
Name
and your Callback
Url.
For this app to work use
http://localhost:8080/playground/oauth2client
.
5. Click
on Add
button
,
you
will see your application under the OAuth Management Page.
You are done with the registration part..!!!
5 . Once
you get access token, Click on “Get Photo”.
- Click on the WSO2 application and copy the Client ID, Client Secret, Access Token URL and Authorize URL. We need these values for our web app.
You are done with the registration part..!!!
Sample App with WSO2 Identity Server :
Download the sample app from here and host it in Tomcat. You can see the app running athttp://localhost:7070/playground
.
- Click
on Import
Photos
- Select
the Grant
Type
as “authorization code”. Enter Client Id , Authorize Endpoint
that we got while registering our Application. Scope is Optional and
click on Authorize.
3. WSO2
Identity Server requests access to noscope, After login click on
Approve.
4. You
will get authorization code, Now enter the value for the Access
Token Endpoint
and Client
Secret
and click Get
Access Token.