Authorization to create device events

Hi everyone.

I created the SmartThings Cloud Connector and deployed it to test.

According to the API documentation at: [API | Developer Documentation | SmartThings]
I’m trying to get an authorization code by request: https://api.smartthings.com/oauth/authorize?response_type=code&client_id=d0b3daf2-4d4a-4617-90f5-ab9376ae9588&scope=w:devices:*&redirect_uri=https://XXXX.ngrok-free.app/

I successfully login but then get an error message: unauthorized client

What am I doing wrong?
Thanks for the help.

I figured out how to get an authorization code and access token in SmartThings Cloud Connector.
I should have read the API documentation carefully:
https://developer.smartthings.com/docs/devices/cloud-connected/interaction-types#reciprocal-access-token

Thanks.