Skip to content

Latest commit

 

History

History
133 lines (85 loc) · 3.18 KB

AuthApi.md

File metadata and controls

133 lines (85 loc) · 3.18 KB

\AuthApi

All URIs are relative to http://localhost

Method HTTP request Description
AuthInfo Get /auth/info Get information about the current authentication mode
Authenticate Post /auth Authenticate towards the node

AuthInfo

AuthInfoModel AuthInfo(ctx).Execute()

Get information about the current authentication mode

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.AuthApi.AuthInfo(context.Background()).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `AuthApi.AuthInfo``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `AuthInfo`: AuthInfoModel
    fmt.Fprintf(os.Stdout, "Response from `AuthApi.AuthInfo`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiAuthInfoRequest struct via the builder pattern

Return type

AuthInfoModel

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Authenticate

LoginResponse Authenticate(ctx).LoginRequest(loginRequest).Execute()

Authenticate towards the node

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    loginRequest := *openapiclient.NewLoginRequest("Password_example", "Username_example") // LoginRequest | The login request

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.AuthApi.Authenticate(context.Background()).LoginRequest(loginRequest).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `AuthApi.Authenticate``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `Authenticate`: LoginResponse
    fmt.Fprintf(os.Stdout, "Response from `AuthApi.Authenticate`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiAuthenticateRequest struct via the builder pattern

Name Type Description Notes
loginRequest LoginRequest The login request

Return type

LoginResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]