        OAuth 2.0 Client Credential Flow - Client Example


This sample demonstrates how to use OAuth 2.0 Client Credential
Flow to communicate with Idenity Provider
(Authorization Server).

This sample is implemented as simple Java Swing based application.
The logic can be used with any thick desktop clients, mobile
applications or even server hosted web applications.


This sample application uses Google OAuth Client API for client credentials 
token request  to retrieve token from Identity Provider 
(Authorization Server) token end-point. 

The OAuth2 Client Credentials Flow requires client ID and client secret
to get token from Identity Provider (Authorization Server) token end-point.  

Pre-Requisites
==============
This sample assumes the expertise with the following technologies

* Java 1.8
* Maven for building and dependency management
* Java Swing UI

Compile
=======
Maven has to be installed to compile and run the example.  Download
maven from http://maven.apache.org/download.cgi and invoke the
following steps

set the JAVA_HOME to Java SDK version 1.8 path

1. edit the file under src/main/resources/oauth.properties. Change the
endpoints to point to an actual implementation of NetIQ Access Manager
Identity Provider.

2. runt the following command
   mvn install

This will compile the sample, package & install in local repository

Run
===

1. issue the following command

mvn exec:java

This will open a Java Swing window.  You can enter clientid and
client secret. Clicking "Get Token Details" will fetch "OAuth 2.0 Access
Token" using Client Credential Flow and display the resultant
json.
