My plan is to create a Gulden Trading app. At this stage I don’t know yet if i’ll have enough time for this project and whether I’ll really manage this, but in this blog I’ll guide you through my journey.
When creating an app which logs in on Nocks.com you can direct your users to do a couple of things. There’s in my opinion only one real way and that is by creating a “Personal Application” in Nocks, which then can be
The objective of this post is to show you the right direction how to authenticate against Nocks; when you have this; you can “talk” to Nocks with your website or app in any way you want.
For the sake of keeping this simple we’ll use the application “Postman” to create the requests;
First things first: You need to make the Personal Application.
- Go to https://www.nocks.com/account/api/personal-clients and click on the button: “Create New Application”
- Enter the name of your (web)Application and for redirect URL use your own Redirect URL. For this sample I’ll use the redirect URL of postman which is: https://www.getpostman.com/oauth2/callback
- Now you’ll see your application in the list with a couple of important data:
- Client ID: In my case: “37”
- Secret: Well it’s secret so keep it secret: But you’ll need it later
- Open Postman and in the following screen enter the following data:
- Enter as URL: https://api.nocks.com/api/v2/user/
- Change the Authentication Type to “OAuth 2.0”
- Click the button “Get New Access Token” and enter the following data
- Token Name: Use the name of your application (This isn’t really important)
- Auth URL: This isn’t currently documented by Nocks!
- Access Token URL:
- Client ID: Enter your Client ID from the data from the Nocks page in my case: “37”
- Client Secret: Enter the Secret string
- Scope: In my example I use “user.all”; you can find all the scopes in the Nocks documentation: https://docs.nocks.com/#scopes
- Grant Type: Authorization CodePlease be aware!
Nocks uses Laravel Passport for their OAuth2 authentication. Therefore if you need any help search for that implementation. The Access Token URL and the Auth URL aren’t currently documented in the Nocks documentation, ask Nocks for help if you’re stuck.
- Click on the button “Request Token” – You’ll be presented the Nocks Login screen. If you have 2FA enabled you’ll also asked to enter your 2FA code.
- Nocks asks you if you’re willing to permit access to your Nocks account via the app you’ve just created. Click “Authorize”
- You will be redirected to Postman and now you’ll see a new Access Token in the list in Postman:
- Click the Access token and make sure the token is added to the Header and click “Use Token”
- Now you’re ready to get the private data with the just received access token.
Click the button “Send” and in the bottom part of Postman you’ll see a JSON string returned with personal user information
- For the sake of keeping my own data safe I won’t enter a screenshot with the JSON string returned.
In the previous steps you did following:
- Register a Nocks Application
- Enter OAuth data for your app to receive an access token
- Create a request with the access token so that you receive personal information.
I hope this post was helpful and you’re able to authenticate your own app against Nocks!
If this guide was helpful to you please consider a donation: