deribit/deribit-api-clients

public_auth_get

wsrajesh opened this issue · 1 comments

when passing the parameters in public_auth_get do we necessarily pass the signature ? if no can you help me with the code?
Thanks in advance...

api_instance = openapi_client.PublicApi(openapi_client.ApiClient(conf))
grant_type = 'bearer'
username = '**'
password = "
"
client_id = client_id
client_secret = client_secret
refresh_token = refresh_tokem
timestamp = " "
signature = " "
nonce = " "
state = " "
scope = "trade:[read, read_write, none]"

try:
# Authenticate
api_response = api_instance.public_auth_get(grant_type, username, password, client_id, client_secret, refresh_token, timestamp, signature, nonce=nonce, state=state, scope=scope)
print(api_response)
print("\n\nthis is api response")
except ApiException as e:
print("Exception when calling PublicApi->public_auth_get: %s\n" % e)

%% authenticate

api_instance = openapi_client.PublicApi(openapi_client.ApiClient(conf))
grant_type = 'bearer'
username = 'wsrajesh'
password = "goldirana3210"
client_id = client_id
client_secret = client_secret
refresh_token = refresh_tokem
timestamp = " "
…nonce=nonce, state=state, scope=scope)
print(api_response)
print("\n\nthis is api response")
except ApiException as e:
print("Exception when calling PublicApi->public_auth_get: %s\n" % e)

%%% this is the response i am getting

send: b'GET /api/v2/public/auth?grant_type=bearer&username=wsh&password=go10&client_id=NeRz&client_secret=bkgibTwOXRLy-8Rm3Flvgrd-_l4HRY&refresh_token=1585823852206.1LI9tDPs.RLuiGdwX3HoLtinqvR62y1jIR99GXofFTJwVlYzukHn_GQvZiZqJoBQIauZ5QIMpULYdX2mhLlk0gumQs7*********************R4CZkXSRnm77oZTh53MM×tamp=+&signature=+&nonce=+&state=+&scope=trade%3A%5Bread%2C+read_write%2C+none%5D HTTP/1.1\r\nHost: www.deribit.com\r\nAccept-Encoding: identity\r\nAccept: application/json\r\nUser-Agent: OpenAPI-Generator/1.0.0/python\r\nAuthorization: Bearer 1585219952206.1DrzDalB.Svfw2BQENXqZYCRtkaiurep7HMUN2EJiQDJO1RkRdzcvAVf_ekI3ZWDYkjXgVOuWDluZ7TIs_RO5shb_IrJ-UBMGmsZyrqshf8MPoVMkhlRcdyQZUfZ5lqmOMMqAic5wJ_lM1dV_lMbGbGC-Jye8WMJvMSK22eSNRvE3glDwoeS29QYyeHeroWY0Vsr2t9_lV5RvXfXAyPvRLmCg-KM0hezBE5kYTREK6fOFUYU_7hrpqI4xYQgZEj0B3eMOKWTy8BtROeCx1zyWjvFdOOldUizLL8seyC9BiVmuOOdMzksaf_fYTA\r\nContent-Type: application/json\r\n\r\n'
reply: 'HTTP/1.1 400 Bad Request\r\n'
header: Server: nginx
header: Date: Thu, 26 Mar 2020 10:54:59 GMT
header: Content-Type: application/json
header: Content-Length: 201
header: Connection: keep-alive
header: Access-Control-Allow-Origin: *
header: Access-Control-Allow-Methods: GET, POST, OPTIONS
header: Access-Control-Allow-Headers: Authorization,User-Agent,Range,X-Requested-With,Content-Type,Partner
Exception when calling PublicApi->public_auth_get: (400)
Reason: Bad Request
HTTP response headers: HTTPHeaderDict({'Server': 'nginx', 'Date': 'Thu, 26 Mar 2020 10:54:59 GMT', 'Content-Type': 'application/json', 'Content-Length': '201', 'Connection': 'keep-alive', 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'GET, POST, OPTIONS', 'Access-Control-Allow-Headers': 'Authorization,User-Agent,Range,X-Requested-With,Content-Type,Partner'})
HTTP response body: {"jsonrpc":"2.0","error":{"message":"Invalid params","data":{"reason":"invalid value","param":"grant_type"},"code":-32602},"testnet":false,"usIn":1585220099772114,"usOut":1585220099772222,"usDiff":108}