Creating a Gulden Trading app: Authorize with Nocks

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.

  1. Go to https://www.nocks.com/account/api/personal-clients and click on the button: “Create New Application”
  2. 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
  3. Now you’ll see your application in the list with a couple of important data:
    1. Client ID: In my case: “37”
    2. Secret: Well it’s secret so keep it secret: But you’ll need it later
  4. Open Postman and in the following screen enter the following data:

    1. Enter as URL: https://api.nocks.com/api/v2/user/
    2. Change the Authentication Type to “OAuth 2.0”
  5. Click the button “Get New Access Token” and enter the following data

    1. Token Name: Use the name of your application (This isn’t really important)
    2. Auth URL: This isn’t currently documented by Nocks!
      https://api.nocks.com/oauth/authorize
    3. Access Token URL:
      https://api.nocks.com/oauth/token
    4. Client ID: Enter your Client ID from the data from the Nocks page in my case: “37”
    5. Client Secret: Enter the Secret string
    6. Scope: In my example I use “user.all”; you can find all the scopes in the Nocks documentation:  https://docs.nocks.com/#scopes
    7. 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.
  6. 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.
  7. Nocks asks you if you’re willing to permit access to your Nocks account via the app you’ve just created. Click “Authorize”
  8. You will be redirected to Postman and now you’ll see a new Access Token in the list in Postman:
  9. Click the Access token and make sure the token is added to the Header and click “Use Token”
  10. 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
  11. 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:

GSf4STDVNn6oacCaMbE8ag9MuQzJx13UgL