cxxmcp 1.1.6
C++ MCP SDK
Loading...
Searching...
No Matches
pkce.hpp
Go to the documentation of this file.
1// Copyright (c) 2025 [caomengxuan666]
2
3#pragma once
4
5#include <string>
6
8
11
12namespace mcp::auth {
13
14enum class PkceCodeChallengeMethod {
15 kS256,
16};
17
20 std::string code_verifier;
21 std::string code_challenge;
22 PkceCodeChallengeMethod method = PkceCodeChallengeMethod::kS256;
23};
24
31 public:
32 virtual ~PkceGenerator() = default;
33
34 virtual core::Result<PkceChallenge> create_s256() = 0;
35 virtual core::Result<bool> verify(const PkceChallenge& challenge) = 0;
36};
37
38} // namespace mcp::auth
Public wrapper around the SDK's private PKCE implementation.
Definition pkce.hpp:30
Shared result and error primitives used by the public cxxmcp SDK.
tl::expected< T, Error > Result
Alias for the SDK result type.
Definition result.hpp:64
PKCE verifier/challenge pair used by OAuth 2.1 authorization flows.
Definition pkce.hpp:19