ContributionsMost RecentMost LikesSolutionsRe: How to get Access Token for OAuth 2.0 using client_credentials using java code? Hello, Thank you for the information. I dont have the client id and client secret. the ready api is executable with the grant type password. i also referred the docs from here : https://docs.apigee.com/api-platform/security/oauth/implementing-password-grant-type Also i tried to execute your code whihc you have shared, but facing an error. added the imports and jar. This is the line of code showing the error : builder.loadTrustMaterial( trustStrategy); The method loadTrustMaterial(org.apache.http.ssl.TrustStrategy) in the type SSLContextBuilder is not applicable for the arguments (org.apache.http.conn.ssl.TrustStrategy) Is it due to version of jar/java? Thanks for your support. Re: How to get Access Token for OAuth 2.0 using client_credentials using java code? Hello, I dont have to sent client id and secret key in my api request. the api call works fine in postman without client id and secret key. the api call needs only grant type, user name, pwd to be send as body or header part. content type must be form-data-url encoded.i have attached the image of post man of the request reference. Is it possible to get the access token without client key and secret as my cuctomer didnt share anything. Re: How to get Access Token for OAuth 2.0 using client_credentials using java code? Hello, Can you please help me how to acheive . I want to get access token from the rest api to access the resources from server. using grant type, user name, paasowrd. tried few methods but not successful. Re: How to get Access Token for OAuth 2.0 using client_credentials using java code? Hello, Am also looking for a solution to implement the access token. I have the rest api which returns the access token. now i want to call that rest call in javainorder to get the access token, by passing grant type, username and password. https://example.com/oauth2/token is the uri. Coud you please share the piece of code or help me out with this how to achieve. Thanks for your support, Ashrey