Skip to content

Latest commit

 

History

History
executable file
·
346 lines (228 loc) · 8.92 KB

AuthenticationApiInterface.md

File metadata and controls

executable file
·
346 lines (228 loc) · 8.92 KB

OpenAPI\Server\Api\AuthenticationApiInterface

All URIs are relative to https://share.catrob.at/api

Method HTTP request Description
authenticationDelete DELETE /authentication Expires refresh token
authenticationGet GET /authentication Check JWT token validity
authenticationOauthPost POST /authentication/oauth OAuth Login
authenticationPost POST /authentication Login - create a new JWT token
authenticationRefreshPost POST /authentication/refresh Refresh token
authenticationUpgradePost POST /authentication/upgrade Upgrade a deprecated token to JWT

Service Declaration

# config/services.yaml
services:
    # ...
    Acme\MyBundle\Api\AuthenticationApi:
        tags:
            - { name: "open_api_server.api", api: "authentication" }
    # ...

authenticationDelete

authenticationDelete($x_refresh)

Expires refresh token

Sets refresh token to expired

Example Implementation

<?php
// src/Acme/MyBundle/Api/AuthenticationApiInterface.php

namespace Acme\MyBundle\Api;

use OpenAPI\Server\Api\AuthenticationApiInterface;

class AuthenticationApi implements AuthenticationApiInterface
{

    // ...

    /**
     * Implementation of AuthenticationApiInterface#authenticationDelete
     */
    public function authenticationDelete(string $x_refresh, int &$responseCode, array &$responseHeaders): void
    {
        // Implement the operation ...
    }

    // ...
}

Parameters

Name Type Description Notes
x_refresh string Refresh Token

Return type

void (empty response body)

Authorization

BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

authenticationGet

authenticationGet()

Check JWT token validity

Checks if a token is valid or expired.

Example Implementation

<?php
// src/Acme/MyBundle/Api/AuthenticationApiInterface.php

namespace Acme\MyBundle\Api;

use OpenAPI\Server\Api\AuthenticationApiInterface;

class AuthenticationApi implements AuthenticationApiInterface
{

    // ...

    /**
     * Implementation of AuthenticationApiInterface#authenticationGet
     */
    public function authenticationGet(int &$responseCode, array &$responseHeaders): void
    {
        // Implement the operation ...
    }

    // ...
}

Parameters

This endpoint does not need any parameter.

Return type

void (empty response body)

Authorization

BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

authenticationOauthPost

OpenAPI\Server\Model\JWTResponse authenticationOauthPost($o_auth_login_request)

OAuth Login

Returns an JWT token which provides authorization

Example Implementation

<?php
// src/Acme/MyBundle/Api/AuthenticationApiInterface.php

namespace Acme\MyBundle\Api;

use OpenAPI\Server\Api\AuthenticationApiInterface;

class AuthenticationApi implements AuthenticationApiInterface
{

    // ...

    /**
     * Implementation of AuthenticationApiInterface#authenticationOauthPost
     */
    public function authenticationOauthPost(OAuthLoginRequest $o_auth_login_request, int &$responseCode, array &$responseHeaders): array|object|null
    {
        // Implement the operation ...
    }

    // ...
}

Parameters

Name Type Description Notes
o_auth_login_request OpenAPI\Server\Model\OAuthLoginRequest

Return type

OpenAPI\Server\Model\JWTResponse

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]

authenticationPost

OpenAPI\Server\Model\JWTResponse authenticationPost($login_request)

Login - create a new JWT token

Returns an JWT token which provides authorization for a limited time

Example Implementation

<?php
// src/Acme/MyBundle/Api/AuthenticationApiInterface.php

namespace Acme\MyBundle\Api;

use OpenAPI\Server\Api\AuthenticationApiInterface;

class AuthenticationApi implements AuthenticationApiInterface
{

    // ...

    /**
     * Implementation of AuthenticationApiInterface#authenticationPost
     */
    public function authenticationPost(LoginRequest $login_request, int &$responseCode, array &$responseHeaders): array|object|null
    {
        // Implement the operation ...
    }

    // ...
}

Parameters

Name Type Description Notes
login_request OpenAPI\Server\Model\LoginRequest

Return type

OpenAPI\Server\Model\JWTResponse

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]

authenticationRefreshPost

OpenAPI\Server\Model\JWTResponse authenticationRefreshPost($refresh_request)

Refresh token

Returns a new JWT token with help of the refresh token

Example Implementation

<?php
// src/Acme/MyBundle/Api/AuthenticationApiInterface.php

namespace Acme\MyBundle\Api;

use OpenAPI\Server\Api\AuthenticationApiInterface;

class AuthenticationApi implements AuthenticationApiInterface
{

    // ...

    /**
     * Implementation of AuthenticationApiInterface#authenticationRefreshPost
     */
    public function authenticationRefreshPost(RefreshRequest $refresh_request, int &$responseCode, array &$responseHeaders): array|object|null
    {
        // Implement the operation ...
    }

    // ...
}

Parameters

Name Type Description Notes
refresh_request OpenAPI\Server\Model\RefreshRequest

Return type

OpenAPI\Server\Model\JWTResponse

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]

authenticationUpgradePost

OpenAPI\Server\Model\JWTResponse authenticationUpgradePost($upgrade_token_request)

Upgrade a deprecated token to JWT

Returns a new JWT token with help of a deprecated upload_token. This allows users to stay signed in apps during the transition to the new API.

Example Implementation

<?php
// src/Acme/MyBundle/Api/AuthenticationApiInterface.php

namespace Acme\MyBundle\Api;

use OpenAPI\Server\Api\AuthenticationApiInterface;

class AuthenticationApi implements AuthenticationApiInterface
{

    // ...

    /**
     * Implementation of AuthenticationApiInterface#authenticationUpgradePost
     */
    public function authenticationUpgradePost(UpgradeTokenRequest $upgrade_token_request, int &$responseCode, array &$responseHeaders): array|object|null
    {
        // Implement the operation ...
    }

    // ...
}

Parameters

Name Type Description Notes
upgrade_token_request OpenAPI\Server\Model\UpgradeTokenRequest

Return type

OpenAPI\Server\Model\JWTResponse

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]