Sourcemeta Core 0.0.0
Loading...
Searching...
No Matches
oauth_client_authentication.h
1#ifndef SOURCEMETA_CORE_OAUTH_CLIENT_AUTHENTICATION_H_
2#define SOURCEMETA_CORE_OAUTH_CLIENT_AUTHENTICATION_H_
3
4#ifndef SOURCEMETA_CORE_OAUTH_EXPORT
5#include <sourcemeta/core/oauth_export.h>
6#endif
7
8#include <sourcemeta/core/crypto.h>
9
10#include <cstdint> // std::uint8_t
11#include <string_view> // std::string_view
12
13namespace sourcemeta::core {
14
31SOURCEMETA_CORE_OAUTH_EXPORT
32auto oauth_client_secret_basic(const std::string_view client_id,
33 const std::string_view client_secret,
34 SecureString &sink) -> void;
35
51SOURCEMETA_CORE_OAUTH_EXPORT
52auto oauth_client_secret_post(const std::string_view client_id,
53 const std::string_view client_secret,
54 SecureString &sink) -> void;
55
70SOURCEMETA_CORE_OAUTH_EXPORT
71auto oauth_client_id_only(const std::string_view client_id, SecureString &sink)
72 -> void;
73
92
101 std::string_view client_id;
103 std::string_view client_secret;
105 std::string_view assertion_type;
107 std::string_view assertion;
108};
109
142SOURCEMETA_CORE_OAUTH_EXPORT
143auto oauth_parse_client_authentication(const std::string_view authorization,
144 const std::string_view body,
145 SecureString &storage,
146 OAuthClientCredentials &credentials)
147 -> bool;
148
149} // namespace sourcemeta::core
150
151#endif
Definition crypto_secure.h:162
@ None
The cookie is sent on every cross-site request.
Definition http.h:273
@ Public
A globally reachable address.
Definition ip.h:58
OAuthClientAuthenticationMethod method
The mechanism the request presented.
Definition oauth_client_authentication.h:99
std::string_view client_secret
The client secret, present only for Basic and Post.
Definition oauth_client_authentication.h:103
std::string_view assertion
The assertion, present only for Assertion (RFC 7521 Section 4.2).
Definition oauth_client_authentication.h:107
std::string_view client_id
The client identifier.
Definition oauth_client_authentication.h:101
std::string_view assertion_type
The assertion type, present only for Assertion (RFC 7521 Section 4.2).
Definition oauth_client_authentication.h:105
SOURCEMETA_CORE_OAUTH_EXPORT auto oauth_client_id_only(const std::string_view client_id, SecureString &sink) -> void
SOURCEMETA_CORE_OAUTH_EXPORT auto oauth_parse_client_authentication(const std::string_view authorization, const std::string_view body, SecureString &storage, OAuthClientCredentials &credentials) -> bool
SOURCEMETA_CORE_OAUTH_EXPORT auto oauth_client_secret_post(const std::string_view client_id, const std::string_view client_secret, SecureString &sink) -> void
SOURCEMETA_CORE_OAUTH_EXPORT auto oauth_client_secret_basic(const std::string_view client_id, const std::string_view client_secret, SecureString &sink) -> void
OAuthClientAuthenticationMethod
Definition oauth_client_authentication.h:79
@ Post
A client_secret in the request body (RFC 6749 Section 2.3.1).
Definition oauth_client_authentication.h:85
@ Assertion
A client_assertion and its type (RFC 7521 Section 4.2).
Definition oauth_client_authentication.h:90
@ Basic
An HTTP Basic credential (RFC 6749 Section 2.3.1).
Definition oauth_client_authentication.h:83
Definition oauth_client_authentication.h:97