Skip to content

Login issues #158

Description

@vivek-k-aggarwal

Hi,

I am using SDK. I have created an app on the portal and generated API KEY and API SECRET.
I used the sample code here, but it didn't worked. It didnt told about auth code to be used in GET TOKEN sampe code.
When I checked documentation, in API segment, it told to use authorize API. Corresponding to the same I use authorize function of LoginApi and provided the relevant parameters.
It returned None.
I verified that URI (same which I provided while creating app) and API KEY is correct as when I changed the URI, it raised exception.
Hence, with None as auth code, I am unable to proceed.
Please help.

Below is the code:
api_instance = upstox_client.LoginApi()
api_version = '2.0'
code = ""
client_id = "#####"
client_secret = "#####"
redirect_uri = "http://localhost"

    code = api_instance.authorize(client_id=client_id, redirect_uri=redirect_uri, api_version=api_version)
    ### I GET NONE here.

    api_response = api_instance.token(api_version, code=code, client_id=client_id,
                                      client_secret=client_secret,
                                      redirect_uri=redirect_uri, grant_type=grant_type)
    print(api_response)

    configuration = upstox_client.Configuration()
    api_instance = upstox_client.LoginApi(upstox_client.ApiClient(configuration))
    body = upstox_client.IndieUserTokenRequest(client_secret=client_secret)
    api_response = api_instance.init_token_request_for_indie_user(body, client_id=client_id)
    print(api_response)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions