Auth SDK for GOLang
The IONOS Cloud SDK Auth for GO provides you with access to the IONOS Cloud Auth API. Use the Auth API to manage tokens for secure access to IONOS Cloud APIs (Auth API, Cloud API, Reseller API, Activity Log API, and others).

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.
  • API version: 1.0
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen

Getting Started

An IONOS account is required for access to the Cloud API; credentials from your registration are used to authenticate against the IONOS Cloud API.

Installation

Install the Go language from the official Go installation guide.
Install the following dependencies:
1
go get github.com/stretchr/testify/assert
2
go get golang.org/x/oauth2
3
go get golang.org/x/net/context
4
go get github.com/antihax/optional
Copied!
Put the package under your project folder by adding it to the go.mod:
1
require "github.com/ionos-cloud/sdk-go-auth"
Copied!
You can get the package locally using:
1
go get "github.com/ionos-cloud/sdk-go-auth"
Copied!

Authentication

The username and password or the authentication token can be manually specified when initializing the sdk client:
1
client := ionossdk.NewAPIClient(ionossdk.NewConfiguration(username, password, token, hostUrl))
Copied!
Environment variables can also be used. The sdk uses the following variables:
  • IONOS_USERNAME - to specify the username used to log in
  • IONOS_PASSWORD - to specify the password
  • IONOS_TOKEN - if an authentication token is being used
  • IONOS_API_URL - to specify the API endpoint in order to overwrite it
In this case, the client configuration needs to be initialized using NewConfigurationFromEnv()
1
client := ionossdk.NewAPIClient(ionossdk.NewConfigurationFromEnv())
Copied!

Environment Variables

Environment Variable
Description
IONOS_USERNAME
Specify the username used to login, to authenticate against the IONOS Cloud API
IONOS_PASSWORD
Specify the password used to login, to authenticate against the IONOS Cloud API
IONOS_TOKEN
Specify the token used to login, if a token is being used instead of username and password
IONOS_API_URL
Specify the API URL. It will overwrite the API endpoint default value api.ionos.com. Note: the host URL does not contain the /cloudapi/v5 path, so it should not be included in the IONOS_API_URL environment variable

Documentation for API Endpoints

All paths are relative to https://api.ionos.com/auth/v1

TokenApi

Method
HTTP request
Description
Get /tokens/generate
Create new tokens
Delete /tokens
Delete tokens by criteria
Delete /tokens/{tokenId}
Delete tokens
Get /tokens
List all tokens
Get /tokens/{tokenId}
Get tokens by Key ID

Documentation For Models

FAQ

  • How can I open a bug report/feature request?
Bug reports and feature requests can be opened in the Issues repository: https://github.com/ionos-cloud/sdk-go-auth/issues/new/choose
  • Can I contribute to the GO SDK for Auth API?
Pure SDKs are automatically generated using OpenAPI Generator and don’t support manual changes. If you require changes, please open an issue, and we will try to address it.
Last modified 5mo ago