issue while login through api auth_code any solution {'s': 'error', 'code': -17, 'message': 'Could not authenticate the user'}

from fyers_api import accessToken

from fyers_api import fyersModel

client_id =‘CX58&*********-100’

secret_key= ‘*********’

redirect_uri = “https://trade.fyers.in/api-login/redirect-uri/index.html

response_type = ‘code’,

session=accessToken.SessionModel(

client_id=client_id,

secret_key=secret_key,

redirect_uri=redirect_uri, 

response_type='code',

grant_type	='authorization_code'

)

response = session.generate_authcode()

print(response)

auth_code =‘***********************************************’

session.set_token(auth_code)

response = session.generate_token()

print(response)

{‘s’: ‘error’, ‘code’: -17, ‘message’: ‘Could not authenticate the user’}

Hi Shivam,
Please make sure you are passing authcode properly after logging in through url provided by ‘session.generate_authcode()’ and generating authcode this is the format you get authcode in
https://redirecturl/?s=ok&code=200&auth_code=authcode&state=None
here ‘&’ after authcode is not a part of authcode try passing it.

secondarily make sure you are using fyers-apiv2 SDK with latest version’2.0.6’