1#ifndef SOURCEMETA_CORE_OAUTH_TOKEN_EXCHANGE_H_
2#define SOURCEMETA_CORE_OAUTH_TOKEN_EXCHANGE_H_
4#ifndef SOURCEMETA_CORE_OAUTH_EXPORT
5#include <sourcemeta/core/oauth_export.h>
8#include <sourcemeta/core/crypto.h>
9#include <sourcemeta/core/json.h>
15namespace sourcemeta::core {
20 "urn:ietf:params:oauth:token-type:access_token"};
24 "urn:ietf:params:oauth:token-type:refresh_token"};
28 "urn:ietf:params:oauth:token-type:id_token"};
32 "urn:ietf:params:oauth:token-type:saml1"};
36 "urn:ietf:params:oauth:token-type:saml2"};
40 "urn:ietf:params:oauth:token-type:jwt"};
87SOURCEMETA_CORE_OAUTH_EXPORT
112SOURCEMETA_CORE_OAUTH_EXPORT
134SOURCEMETA_CORE_OAUTH_EXPORT
136 -> std::optional<std::string_view>;
std::string_view actor_token_type
The type of the actor token, emitted only together with the actor token.
Definition oauth_token_exchange.h:57
std::string_view requested_token_type
The requested type for the issued token (RFC 8693 Section 2.1).
Definition oauth_token_exchange.h:59
std::span< const std::string_view > audiences
Definition oauth_token_exchange.h:64
std::string_view subject_token_type
The type of the subject token, REQUIRED (RFC 8693 Section 2.1).
Definition oauth_token_exchange.h:52
std::span< const std::string_view > resources
Definition oauth_token_exchange.h:67
std::string_view scope
The space-delimited requested scope (RFC 6749 Section 3.3).
Definition oauth_token_exchange.h:61
std::string_view actor_token
Definition oauth_token_exchange.h:55
std::string_view subject_token
Definition oauth_token_exchange.h:50
constexpr std::string_view OAUTH_TOKEN_TYPE_ACCESS_TOKEN
Definition oauth_token_exchange.h:19
constexpr std::string_view OAUTH_TOKEN_TYPE_JWT
Definition oauth_token_exchange.h:39
SOURCEMETA_CORE_OAUTH_EXPORT auto oauth_token_exchange_valid(const OAuthTokenExchangeRequest &request) -> bool
constexpr std::string_view OAUTH_TOKEN_TYPE_SAML1
Definition oauth_token_exchange.h:31
constexpr std::string_view OAUTH_TOKEN_TYPE_REFRESH_TOKEN
Definition oauth_token_exchange.h:23
constexpr std::string_view OAUTH_TOKEN_TYPE_ID_TOKEN
Definition oauth_token_exchange.h:27
constexpr std::string_view OAUTH_TOKEN_TYPE_SAML2
Definition oauth_token_exchange.h:35
SOURCEMETA_CORE_OAUTH_EXPORT auto oauth_build_token_request_exchange(const OAuthTokenExchangeRequest &request, SecureString &sink) -> bool
SOURCEMETA_CORE_OAUTH_EXPORT auto oauth_issued_token_type(const JSON &response) -> std::optional< std::string_view >