You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a generated OpenAPI client, authentication does not work, as the authorization information is missing. This in turn leads to the authentication information not being sent.
Generating the OpenAPI client despite specification errors
importopenapi_clientfromopenapi_client.restimportApiExceptionfrompprintimportpprint# Defining the host is optional and defaults to https://api.autodns.com/v1# See configuration.py for a list of all supported configuration parameters.configuration=openapi_client.Configuration(
host="https://api.autodns.com/v1"username="username"password="password"
)
Setting a password in the client configuration like in the example above has no effect, due to the missing authorization data in the specification, which is visible in the generated documentation, seen below. Any API calls requiring authentication lead to a 401 error, despite username and password being set.
importopenapi_clientfromopenapi_client.models.contactimportContactfromopenapi_client.models.json_response_data_contactimportJsonResponseDataContactfromopenapi_client.restimportApiExceptionfrompprintimportpprint# Defining the host is optional and defaults to https://api.autodns.com/v1# See configuration.py for a list of all supported configuration parameters.configuration=openapi_client.Configuration(
host="https://api.autodns.com/v1"
)
# Enter a context with an instance of the API clientwithopenapi_client.ApiClient(configuration) asapi_client:
# Create an instance of the API classapi_instance=openapi_client.ContactTasksApi(api_client)
x_domainrobot_domain_safe_pin='x_domainrobot_domain_safe_pin_example'# str | (optional)x_domainrobot_domain_safe_transaction='x_domainrobot_domain_safe_transaction_example'# str | (optional)x_domainrobot_domain_safe_transaction_expire='2013-10-20T19:20:30+01:00'# datetime | (optional)x_domainrobot_domain_safe_tan='x_domainrobot_domain_safe_tan_example'# str | (optional)x_domainrobot_owner_user='x_domainrobot_owner_user_example'# str | (optional)x_domainrobot_owner_context=56# int | (optional)x_domainrobot_demo=True# bool | (optional)x_domainrobot_session_id='x_domainrobot_session_id_example'# str | (optional)x_domainrobot_context=56# int | (optional)x_domainrobot_ws='x_domainrobot_ws_example'# str | (optional)x_domainrobot_bulk_limit=56# int | (optional)x_domainrobot_2_fa_token=56# int | (optional)keys= ['?keys[]=force_handle_create'] # List[str] | The query parameter wich enables the force mode if the key is set. (optional)contact=openapi_client.Contact() # Contact | (optional)try:
# Contact Create (0301)api_response=api_instance.contact_create(x_domainrobot_domain_safe_pin=x_domainrobot_domain_safe_pin, x_domainrobot_domain_safe_transaction=x_domainrobot_domain_safe_transaction, x_domainrobot_domain_safe_transaction_expire=x_domainrobot_domain_safe_transaction_expire, x_domainrobot_domain_safe_tan=x_domainrobot_domain_safe_tan, x_domainrobot_owner_user=x_domainrobot_owner_user, x_domainrobot_owner_context=x_domainrobot_owner_context, x_domainrobot_demo=x_domainrobot_demo, x_domainrobot_session_id=x_domainrobot_session_id, x_domainrobot_context=x_domainrobot_context, x_domainrobot_ws=x_domainrobot_ws, x_domainrobot_bulk_limit=x_domainrobot_bulk_limit, x_domainrobot_2_fa_token=x_domainrobot_2_fa_token, keys=keys, contact=contact)
print("The response of ContactTasksApi->contact_create:\n")
pprint(api_response)
exceptExceptionase:
print("Exception when calling ContactTasksApi->contact_create: %s\n"%e)
Original issue posted in: InterNetX/js-domainrobot-sdk#114
In a generated OpenAPI client, authentication does not work, as the authorization information is missing. This in turn leads to the authentication information not being sent.
Generating the OpenAPI client despite specification errors
Setting Up the OpenAPI client
Setting a password in the client configuration like in the example above has no effect, due to the missing authorization data in the specification, which is visible in the generated documentation, seen below. Any API calls requiring authentication lead to a 401 error, despite username and password being set.
contact_create
Contact Create (0301)
Creating a new domain contact.
Example
Parameters
Return type
JsonResponseDataContact
Authorization
No authorization required
HTTP request headers
HTTP response details
The text was updated successfully, but these errors were encountered: