Skip to content

Latest commit

 

History

History
533 lines (365 loc) · 15 KB

AuthApi.md

File metadata and controls

533 lines (365 loc) · 15 KB

forestvpn_api.api.AuthApi

Load the API package

import 'package:forestvpn_api/api.dart';

All URIs are relative to https://api.forestvpn.com/v2

Method HTTP request Description
authorizeAccessTokenRequest POST /auth/access-token-requests/{requestID}/authorize/ Authorize access token request
createAccessTokenRequest POST /auth/access-token-requests/ Create access token request
getAccessTokenRequest GET /auth/access-token-requests/{requestID}/ Get access token request details
loginToken POST /auth/token/login/ Login with JWT token
migrateLegacyAuth GET /legacy/auth/ Legacy auth migration
obtainToken GET /auth/token/obtain/ Obtain JWT token
revokeAccessTokenRequest POST /auth/access-token-requests/{requestID}/revoke/ Revoke access token request
updateUserPhoto PATCH /auth/profile/photo/ Update profile photo
updateUserProfile PATCH /auth/profile/ Update profile
userPhoto GET /auth/profile/photo/ Photo
userProfile GET /auth/profile/ Profile
whoAmI GET /auth/whoami/ Who am I

authorizeAccessTokenRequest

AccessTokenRequest authorizeAccessTokenRequest(requestID)

Authorize access token request

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getAuthApi();
final String requestID = requestID_example; // String | 

try {
    final response = api.authorizeAccessTokenRequest(requestID);
    print(response);
} catch on DioError (e) {
    print('Exception when calling AuthApi->authorizeAccessTokenRequest: $e\n');
}

Parameters

Name Type Description Notes
requestID String

Return type

AccessTokenRequest

Authorization

bearerAuth

HTTP request headers

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

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

createAccessTokenRequest

AccessTokenRequest createAccessTokenRequest(name)

Create access token request

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getAuthApi();
final String name = name_example; // String | 

try {
    final response = api.createAccessTokenRequest(name);
    print(response);
} catch on DioError (e) {
    print('Exception when calling AuthApi->createAccessTokenRequest: $e\n');
}

Parameters

Name Type Description Notes
name String [optional]

Return type

AccessTokenRequest

Authorization

bearerAuth

HTTP request headers

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

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

getAccessTokenRequest

AccessTokenRequest getAccessTokenRequest(requestID)

Get access token request details

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getAuthApi();
final String requestID = requestID_example; // String | 

try {
    final response = api.getAccessTokenRequest(requestID);
    print(response);
} catch on DioError (e) {
    print('Exception when calling AuthApi->getAccessTokenRequest: $e\n');
}

Parameters

Name Type Description Notes
requestID String

Return type

AccessTokenRequest

Authorization

bearerAuth

HTTP request headers

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

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

loginToken

TokenLogin loginToken(createTokenLogin)

Login with JWT token

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getAuthApi();
final CreateTokenLogin createTokenLogin = ; // CreateTokenLogin | 

try {
    final response = api.loginToken(createTokenLogin);
    print(response);
} catch on DioError (e) {
    print('Exception when calling AuthApi->loginToken: $e\n');
}

Parameters

Name Type Description Notes
createTokenLogin CreateTokenLogin [optional]

Return type

TokenLogin

Authorization

bearerAuth

HTTP request headers

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

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

migrateLegacyAuth

LegacyAuthMigrationToken migrateLegacyAuth()

Legacy auth migration

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getAuthApi();

try {
    final response = api.migrateLegacyAuth();
    print(response);
} catch on DioError (e) {
    print('Exception when calling AuthApi->migrateLegacyAuth: $e\n');
}

Parameters

This endpoint does not need any parameter.

Return type

LegacyAuthMigrationToken

Authorization

bearerAuth

HTTP request headers

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

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

obtainToken

TokenObtain obtainToken()

Obtain JWT token

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getAuthApi();

try {
    final response = api.obtainToken();
    print(response);
} catch on DioError (e) {
    print('Exception when calling AuthApi->obtainToken: $e\n');
}

Parameters

This endpoint does not need any parameter.

Return type

TokenObtain

Authorization

bearerAuth

HTTP request headers

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

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

revokeAccessTokenRequest

AccessTokenRequest revokeAccessTokenRequest(requestID)

Revoke access token request

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getAuthApi();
final String requestID = requestID_example; // String | 

try {
    final response = api.revokeAccessTokenRequest(requestID);
    print(response);
} catch on DioError (e) {
    print('Exception when calling AuthApi->revokeAccessTokenRequest: $e\n');
}

Parameters

Name Type Description Notes
requestID String

Return type

AccessTokenRequest

Authorization

bearerAuth

HTTP request headers

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

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

updateUserPhoto

UserPhoto updateUserPhoto(userPhoto)

Update profile photo

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getAuthApi();
final UserPhoto userPhoto = ; // UserPhoto | 

try {
    final response = api.updateUserPhoto(userPhoto);
    print(response);
} catch on DioError (e) {
    print('Exception when calling AuthApi->updateUserPhoto: $e\n');
}

Parameters

Name Type Description Notes
userPhoto UserPhoto [optional]

Return type

UserPhoto

Authorization

bearerAuth

HTTP request headers

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

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

updateUserProfile

User updateUserProfile(user)

Update profile

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getAuthApi();
final User user = ; // User | 

try {
    final response = api.updateUserProfile(user);
    print(response);
} catch on DioError (e) {
    print('Exception when calling AuthApi->updateUserProfile: $e\n');
}

Parameters

Name Type Description Notes
user User [optional]

Return type

User

Authorization

bearerAuth

HTTP request headers

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

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

userPhoto

UserPhoto userPhoto()

Photo

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getAuthApi();

try {
    final response = api.userPhoto();
    print(response);
} catch on DioError (e) {
    print('Exception when calling AuthApi->userPhoto: $e\n');
}

Parameters

This endpoint does not need any parameter.

Return type

UserPhoto

Authorization

bearerAuth

HTTP request headers

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

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

userProfile

User userProfile()

Profile

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getAuthApi();

try {
    final response = api.userProfile();
    print(response);
} catch on DioError (e) {
    print('Exception when calling AuthApi->userProfile: $e\n');
}

Parameters

This endpoint does not need any parameter.

Return type

User

Authorization

bearerAuth

HTTP request headers

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

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

whoAmI

User whoAmI()

Who am I

Example

import 'package:forestvpn_api/api.dart';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';

final api = ForestvpnApi().getAuthApi();

try {
    final response = api.whoAmI();
    print(response);
} catch on DioError (e) {
    print('Exception when calling AuthApi->whoAmI: $e\n');
}

Parameters

This endpoint does not need any parameter.

Return type

User

Authorization

bearerAuth

HTTP request headers

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

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