mirror of
https://bitbucket.org/myhomie/myhomie_app.git
synced 2025-12-06 00:51:19 +00:00
3.5 KiB
3.5 KiB
mycoreapi.api.AuthenticationApi
Load the API package
import 'package:mycoreapi/api.dart';
All URIs are relative to https://localhost:5001
| Method | HTTP request | Description |
|---|---|---|
| authenticationAuthenticateWithForm | POST /api/Authentication/Token | Authenticate with form parameters (used by Swagger test client) |
| authenticationAuthenticateWithJson | POST /api/Authentication/Authenticate | Authenticate with Json parameters (used by most clients) |
authenticationAuthenticateWithForm
TokenDTO authenticationAuthenticateWithForm(grantType, username, password, clientId, clientSecret)
Authenticate with form parameters (used by Swagger test client)
Example
import 'package:mycoreapi/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = AuthenticationApi();
final grantType = grantType_example; // String |
final username = username_example; // String |
final password = password_example; // String |
final clientId = clientId_example; // String |
final clientSecret = clientSecret_example; // String |
try {
final result = api_instance.authenticationAuthenticateWithForm(grantType, username, password, clientId, clientSecret);
print(result);
} catch (e) {
print('Exception when calling AuthenticationApi->authenticationAuthenticateWithForm: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| grantType | String | [optional] | |
| username | String | [optional] | |
| password | String | [optional] | |
| clientId | String | [optional] | |
| clientSecret | String | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: multipart/form-data
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
authenticationAuthenticateWithJson
TokenDTO authenticationAuthenticateWithJson(loginDTO)
Authenticate with Json parameters (used by most clients)
Example
import 'package:mycoreapi/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = AuthenticationApi();
final loginDTO = LoginDTO(); // LoginDTO | Login DTO
try {
final result = api_instance.authenticationAuthenticateWithJson(loginDTO);
print(result);
} catch (e) {
print('Exception when calling AuthenticationApi->authenticationAuthenticateWithJson: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| loginDTO | LoginDTO | Login DTO |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]