All URIs are relative to http://localhost, except if the operation defines another base path.
| Method | HTTP request | Description |
|---|---|---|
| devLogin() | POST /v2/auth/devlogin | (DEV MODE) Login |
| elementsLoginAs() | POST /v2/auth/elements_login_as | Elements Login As |
| login() | POST /v2/auth/login | Login |
| loginElements() | GET /v2/auth/login_elements | Login Elements |
| logoutGet() | GET /v2/auth/logout | Logout Get |
| logoutPost() | POST /v2/auth/logout | Logout Post |
| me() | GET /v2/auth/me | Me |
| switchOrganization() | POST /v2/auth/switch_org/{org_id} | Switch Organization |
devLogin($dev_login)(DEV MODE) Login
The dev-login endpoints allows a developer inside permit.io to log in with an email address. THIS IS ONLY AVAILABLE IN DEV MODE.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new OpenAPI\Client\Api\AuthenticationApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$dev_login = new \OpenAPI\Client\Model\DevLogin(); // \OpenAPI\Client\Model\DevLogin
try {
$apiInstance->devLogin($dev_login);
} catch (Exception $e) {
echo 'Exception when calling AuthenticationApi->devLogin: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| dev_login | \OpenAPI\Client\Model\DevLogin |
void (empty response body)
No authorization required
- Content-Type:
application/json - Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
elementsLoginAs($user_login_request_input): \OpenAPI\Client\Model\EmbeddedLoginRequestOutputElements Login As
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer (JWT) authorization: HTTPBearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new OpenAPI\Client\Api\AuthenticationApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$user_login_request_input = new \OpenAPI\Client\Model\UserLoginRequestInput(); // \OpenAPI\Client\Model\UserLoginRequestInput
try {
$result = $apiInstance->elementsLoginAs($user_login_request_input);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AuthenticationApi->elementsLoginAs: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| user_login_request_input | \OpenAPI\Client\Model\UserLoginRequestInput |
\OpenAPI\Client\Model\EmbeddedLoginRequestOutput
- Content-Type:
application/json - Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
login($invite_code): \OpenAPI\Client\Model\LoginResultLogin
The login endpoint allows the frontend app to exchange a user JWT with a user session. The user session is stored on an httpOnly + secure cookie.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer (JWT) authorization: HTTPBearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new OpenAPI\Client\Api\AuthenticationApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$invite_code = 'invite_code_example'; // string | An optional invite code to an existing organization. If the invite code is provided and is valid, the member will gain access to that organization.
try {
$result = $apiInstance->login($invite_code);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AuthenticationApi->login: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| invite_code | string | An optional invite code to an existing organization. If the invite code is provided and is valid, the member will gain access to that organization. | [optional] |
\OpenAPI\Client\Model\LoginResult
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
loginElements($token): \OpenAPI\Client\Model\LoginResultLogin Elements
The login endpoint allows the frontend app to exchange a user JWT with a user session. The user session is stored on an httpOnly + secure cookie.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new OpenAPI\Client\Api\AuthenticationApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$token = 'token_example'; // string
try {
$result = $apiInstance->loginElements($token);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AuthenticationApi->loginElements: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| token | string |
\OpenAPI\Client\Model\LoginResult
No authorization required
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
logoutGet()Logout Get
The logout endpoint deletes the session cookie of a logged in user and invalidates cached VCs.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new OpenAPI\Client\Api\AuthenticationApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
try {
$apiInstance->logoutGet();
} catch (Exception $e) {
echo 'Exception when calling AuthenticationApi->logoutGet: ', $e->getMessage(), PHP_EOL;
}This endpoint does not need any parameter.
void (empty response body)
No authorization required
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
logoutPost()Logout Post
The logout endpoint deletes the session cookie of a logged in user and invalidates cached VCs.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new OpenAPI\Client\Api\AuthenticationApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
try {
$apiInstance->logoutPost();
} catch (Exception $e) {
echo 'Exception when calling AuthenticationApi->logoutPost: ', $e->getMessage(), PHP_EOL;
}This endpoint does not need any parameter.
void (empty response body)
No authorization required
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
me(): \OpenAPI\Client\Model\AuthnMeReadMe
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer (JWT) authorization: HTTPBearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new OpenAPI\Client\Api\AuthenticationApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
try {
$result = $apiInstance->me();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AuthenticationApi->me: ', $e->getMessage(), PHP_EOL;
}This endpoint does not need any parameter.
\OpenAPI\Client\Model\AuthnMeRead
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
switchOrganization($org_id): \OpenAPI\Client\Model\LoginResultSwitch Organization
Allows the user to switch his active organization (manipulates the user's login session). This route will return a new login cookie to the user.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new OpenAPI\Client\Api\AuthenticationApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$org_id = 'org_id_example'; // string | the organization id the user wishes to switch to as the active org on the session
try {
$result = $apiInstance->switchOrganization($org_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AuthenticationApi->switchOrganization: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| org_id | string | the organization id the user wishes to switch to as the active org on the session |
\OpenAPI\Client\Model\LoginResult
No authorization required
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]