Acces to users repository with Oauth

I would like to access particular users repository  with Oauth so how can I do that can anybody help me how to get the files of users repository thanks

You will have to create an OAuth application for doing so. You can follow the steps given here.

After you have successfully created the OAuth application, you will make a call to your specific endpoint( in your case) with a header of the form {Authorization:‘token <access_token>’}. Now, to get this <access_token>, you have to make another POST call to

When you hit your specific endpoint(, you would be asked tyo authorise permission to the OAuth application you created. If any user accepts your request, GitHub redirects back to your site with a temporary code (as a query parameter in the URL) in a code parameter. Then, you will have to make a POST call with specific parameters of the form:


The parameters to be passed in the form of data in the POST call are: 

Name Type Description

client_id string Required. The client ID you received from GitHub for your GitHub App.
client_secret string Required. The client secret you received from GitHub for your GitHub App
code string Required. The code you received as a response to above step
redirect_uri string The URL in your application where users are sent after authorization
state string The unguessable random string you provided in above step

The client_is and client_secret can be accessed from the OAuth application you created in the first step and the code will be present in the query parameter in the URL(Other parameters are not compulsory).

Hence, you get your <access_token>

Finally, to fetch a particular user’s repo, you will make a call of the form:


 Also, you willl have to pass the Authorization header as described above.