144 lines
3.8 KiB
Markdown
144 lines
3.8 KiB
Markdown
# \TokenAPI
|
|
|
|
All URIs are relative to *http://localhost*
|
|
|
|
Method | HTTP request | Description
|
|
------------- | ------------- | -------------
|
|
[**LoginForAccessTokenTokenPost**](TokenAPI.md#LoginForAccessTokenTokenPost) | **Post** /token | Login For Access Token
|
|
[**TestLoginTestLoginGet**](TokenAPI.md#TestLoginTestLoginGet) | **Get** /test/login | Test Login
|
|
|
|
|
|
|
|
## LoginForAccessTokenTokenPost
|
|
|
|
> Token LoginForAccessTokenTokenPost(ctx).Username(username).Password(password).GrantType(grantType).Scope(scope).ClientId(clientId).ClientSecret(clientSecret).Execute()
|
|
|
|
Login For Access Token
|
|
|
|
### Example
|
|
|
|
```go
|
|
package main
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"os"
|
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
|
)
|
|
|
|
func main() {
|
|
username := "username_example" // string |
|
|
password := "password_example" // string |
|
|
grantType := "grantType_example" // string | (optional)
|
|
scope := "scope_example" // string | (optional) (default to "")
|
|
clientId := "clientId_example" // string | (optional)
|
|
clientSecret := "clientSecret_example" // string | (optional)
|
|
|
|
configuration := openapiclient.NewConfiguration()
|
|
apiClient := openapiclient.NewAPIClient(configuration)
|
|
resp, r, err := apiClient.TokenAPI.LoginForAccessTokenTokenPost(context.Background()).Username(username).Password(password).GrantType(grantType).Scope(scope).ClientId(clientId).ClientSecret(clientSecret).Execute()
|
|
if err != nil {
|
|
fmt.Fprintf(os.Stderr, "Error when calling `TokenAPI.LoginForAccessTokenTokenPost``: %v\n", err)
|
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
|
}
|
|
// response from `LoginForAccessTokenTokenPost`: Token
|
|
fmt.Fprintf(os.Stdout, "Response from `TokenAPI.LoginForAccessTokenTokenPost`: %v\n", resp)
|
|
}
|
|
```
|
|
|
|
### Path Parameters
|
|
|
|
|
|
|
|
### Other Parameters
|
|
|
|
Other parameters are passed through a pointer to a apiLoginForAccessTokenTokenPostRequest struct via the builder pattern
|
|
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**username** | **string** | |
|
|
**password** | **string** | |
|
|
**grantType** | **string** | |
|
|
**scope** | **string** | | [default to ""]
|
|
**clientId** | **string** | |
|
|
**clientSecret** | **string** | |
|
|
|
|
### Return type
|
|
|
|
[**Token**](Token.md)
|
|
|
|
### Authorization
|
|
|
|
No authorization required
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/x-www-form-urlencoded
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
|
|
[[Back to Model list]](../README.md#documentation-for-models)
|
|
[[Back to README]](../README.md)
|
|
|
|
|
|
## TestLoginTestLoginGet
|
|
|
|
> UserDB TestLoginTestLoginGet(ctx).Execute()
|
|
|
|
Test Login
|
|
|
|
### Example
|
|
|
|
```go
|
|
package main
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"os"
|
|
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
|
)
|
|
|
|
func main() {
|
|
|
|
configuration := openapiclient.NewConfiguration()
|
|
apiClient := openapiclient.NewAPIClient(configuration)
|
|
resp, r, err := apiClient.TokenAPI.TestLoginTestLoginGet(context.Background()).Execute()
|
|
if err != nil {
|
|
fmt.Fprintf(os.Stderr, "Error when calling `TokenAPI.TestLoginTestLoginGet``: %v\n", err)
|
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
|
}
|
|
// response from `TestLoginTestLoginGet`: UserDB
|
|
fmt.Fprintf(os.Stdout, "Response from `TokenAPI.TestLoginTestLoginGet`: %v\n", resp)
|
|
}
|
|
```
|
|
|
|
### Path Parameters
|
|
|
|
This endpoint does not need any parameter.
|
|
|
|
### Other Parameters
|
|
|
|
Other parameters are passed through a pointer to a apiTestLoginTestLoginGetRequest struct via the builder pattern
|
|
|
|
|
|
### Return type
|
|
|
|
[**UserDB**](UserDB.md)
|
|
|
|
### Authorization
|
|
|
|
[OAuth2PasswordBearer](../README.md#OAuth2PasswordBearer)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: Not defined
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
|
|
[[Back to Model list]](../README.md#documentation-for-models)
|
|
[[Back to README]](../README.md)
|
|
|