Fetching Token form TokenEndPointURL

Issue #57 invalid
Vinoj Mathew created an issue

I am wondering is there any method available here to fetch the token from using grant type is credential using tokenEndpoint Url

I will have the following input

1)TokenEndPointurl -> https://login.microsoftonline.com/ed841e4cfd71414926c/oauth2/token

2) clientid/client scrent :-> xxxxxx/xxxxxx

3) grant_type---->client_credentials

4) resource=>http://dataservicespoc.onmicrosoft.com/PartyOData

This will return the token:

grant_type=client_credentials&client_id=ce705a3c-f80c-4447-9ebd-e1e061cd8eaf&client_secret=XXXXXXXXXX=&resource=http://dataservicespoc.onmicrosoft.com/PartyOData

Thanks

Comments (5)

  1. Brian Campbell repo owner

    That's really beyond the scope of this library, which is JOSE/JWT processing. You could use HttpURLConnection or Apache's HttpClient to make the HTTP request. There are likely OAuth client libraries too, which could help, but if all you need is a POST with the client credentials, one of those (or similar) is probably enough. JsonUtil in this library is a simple tool that can parse the response or and JSON processor that you like.

  2. Log in to comment