Smartthings api log in to give access

smartthings API log in to give access

what I’m trying to do is request access to an API token by logging into smarthings
you know how when you log into an app it gives you the option to log into a servicer and it will request access to that service

the function I’m trying to create

  1. a button that says log into smartthings
    2)then the popup says would you like to give this app access to smartthings services
  2. you press yes and it gives the service access ether providing it an API token or some other form access where I can later full information from the smarthings service

the end result should be I get a personal access token from here https://account.smartthings.com/tokens

bellow is an example of how it works with ifttt I am trying to do something similar

they are using this URL command https://graph.api.smartthings.com/oauth/confirm_access?