Sourcemeta Core 0.0.0
Loading...
Searching...
No Matches
oidc_userinfo.h
1#ifndef SOURCEMETA_CORE_OIDC_USERINFO_H_
2#define SOURCEMETA_CORE_OIDC_USERINFO_H_
3
4#ifndef SOURCEMETA_CORE_OIDC_EXPORT
5#include <sourcemeta/core/oidc_export.h>
6#endif
7
8#include <sourcemeta/core/jose.h>
9#include <sourcemeta/core/json.h>
10
11#include <optional> // std::optional
12#include <span> // std::span
13#include <string_view> // std::string_view
14
15namespace sourcemeta::core {
16
31SOURCEMETA_CORE_OIDC_EXPORT
32auto oidc_build_userinfo(const std::string_view subject,
33 const JSON &additional_claims) -> JSON;
34
48SOURCEMETA_CORE_OIDC_EXPORT
50 const std::string_view expected_subject)
51 -> bool;
52
76SOURCEMETA_CORE_OIDC_EXPORT
78 const JWT &token, const JWKS &keys,
79 const std::span<const JWSAlgorithm> allowed_algorithms,
80 const std::string_view expected_subject,
81 const std::string_view expected_issuer,
82 const std::string_view expected_client_id) -> std::optional<JSON>;
83
84} // namespace sourcemeta::core
85
86#endif
Definition jose_jwks.h:40
Definition jose_jwt.h:38
Definition json_value.h:39
SOURCEMETA_CORE_OIDC_EXPORT auto oidc_userinfo_matches_subject(const JSON &userinfo, const std::string_view expected_subject) -> bool
SOURCEMETA_CORE_OIDC_EXPORT auto oidc_verify_userinfo(const JWT &token, const JWKS &keys, const std::span< const JWSAlgorithm > allowed_algorithms, const std::string_view expected_subject, const std::string_view expected_issuer, const std::string_view expected_client_id) -> std::optional< JSON >
SOURCEMETA_CORE_OIDC_EXPORT auto oidc_build_userinfo(const std::string_view subject, const JSON &additional_claims) -> JSON