1#ifndef SOURCEMETA_CORE_OAUTH_INTROSPECTION_H_
2#define SOURCEMETA_CORE_OAUTH_INTROSPECTION_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 {
18#pragma warning(disable : 4251)
38SOURCEMETA_CORE_OAUTH_EXPORT
40 const std::string_view token_type_hint,
69 [[nodiscard]]
auto active() const noexcept ->
bool;
72 [[nodiscard]] auto
scope() const -> std::optional<std::string_view>;
74 [[nodiscard]] auto
client_id() const -> std::optional<std::string_view>;
76 [[nodiscard]] auto
username() const -> std::optional<std::string_view>;
79 [[nodiscard]] auto
token_type() const -> std::optional<std::string_view>;
81 [[nodiscard]] auto
subject() const -> std::optional<std::string_view>;
83 [[nodiscard]] auto
issuer() const -> std::optional<std::string_view>;
85 [[nodiscard]] auto
jti() const -> std::optional<std::string_view>;
87 [[nodiscard]] auto
expiration() const -> std::optional<std::chrono::seconds>;
89 [[nodiscard]] auto
issued_at() const -> std::optional<std::chrono::seconds>;
91 [[nodiscard]] auto
not_before() const -> std::optional<std::chrono::seconds>;
95 [[nodiscard]] auto
data() const -> const
JSON &;
103#pragma warning(default : 4251)
118SOURCEMETA_CORE_OAUTH_EXPORT
auto issued_at() const -> std::optional< std::chrono::seconds >
The issuance time (RFC 7662 Section 2.2).
auto jti() const -> std::optional< std::string_view >
The identifier of the token (RFC 7662 Section 2.2).
auto active() const noexcept -> bool
auto token_type() const -> std::optional< std::string_view >
auto client_id() const -> std::optional< std::string_view >
The client identifier the token was issued to (RFC 7662 Section 2.2).
auto issuer() const -> std::optional< std::string_view >
The issuer of the token (RFC 7662 Section 2.2).
auto data() const -> const JSON &
auto subject() const -> std::optional< std::string_view >
The subject of the token (RFC 7662 Section 2.2).
auto expiration() const -> std::optional< std::chrono::seconds >
The expiration time (RFC 7662 Section 2.2), or no value when absent.
auto not_before() const -> std::optional< std::chrono::seconds >
The not-before time (RFC 7662 Section 2.2).
auto username() const -> std::optional< std::string_view >
The resource owner username (RFC 7662 Section 2.2).
auto scope() const -> std::optional< std::string_view >
The space-delimited scope (RFC 7662 Section 2.2), or no value when absent.
OAuthIntrospectionResponse(const JSON &data)
SOURCEMETA_CORE_OAUTH_EXPORT auto oauth_build_introspection_request(const std::string_view token, const std::string_view token_type_hint, SecureString &sink) -> void
SOURCEMETA_CORE_OAUTH_EXPORT auto oauth_make_introspection_inactive() -> JSON