1#ifndef TENDUKE_OAUTH_OAUTHCLIENTCONFIGURATION_H
2#define TENDUKE_OAUTH_OAUTHCLIENTCONFIGURATION_H
4#include "crypto/PublicKey.h"
67 case PKCE:
return "PKCE";
68 case DEVICE:
return "DEVICE";
69 default:
return "UNKNOWN";
80 if (
"DEVICE" ==
string) {
81 return OAuthFlow::DEVICE;
83 if (
"PKCE" ==
string) {
84 return OAuthFlow::PKCE;
86 return OAuthFlow::UNKNOWN;
108 this->oauthClientId = pClientId;
119 this->oauthRedirectURI = pRedirectURI;
130 this->oauthClientSecret = pClientSecret;
150 std::string oauthClientId;
152 std::string oauthClientSecret;
154 std::string oauthRedirectURI;
165 return Builder(OAuthFlow::PKCE);
Builder for the configuration.
Definition OAuthClientConfiguration.h:93
Builder & clientSecret(const std::string &pClientSecret)
Fluently sets client secret.
Definition OAuthClientConfiguration.h:128
Builder & clientId(const std::string &pClientId)
Fluent sets the OAuth client id.
Definition OAuthClientConfiguration.h:106
Builder(const OAuthFlow flow)
Constructs new instance.
Definition OAuthClientConfiguration.h:99
OAuthClientConfiguration build()
Builds the configuration.
Definition OAuthClientConfiguration.h:138
Builder & redirectURI(const std::string &pRedirectURI)
Fluently sets redirect URI.
Definition OAuthClientConfiguration.h:117
Container for OAuth-client-configuration.
Definition OAuthClientConfiguration.h:17
enum OAuthFlow flow
The flow.
Definition OAuthClientConfiguration.h:55
const std::string clientSecret
(Optional) OAuth 2 client secret, configured also in the server.
Definition OAuthClientConfiguration.h:50
static Builder forPKCEFlow()
Starts building configuration for PKCE-flow.
Definition OAuthClientConfiguration.h:163
const std::string clientId
OAuth 2 client id, configured also in the server.
Definition OAuthClientConfiguration.h:48
const std::string redirectURI
OAuth2 redirect-URI for browser-based based authentication.
Definition OAuthClientConfiguration.h:52
OAuthClientConfiguration(std::string clientId, std::string clientSecret, std::string redirectURI, const enum OAuthFlow flow)
Constructs new instance.
Definition OAuthClientConfiguration.h:36
OAuthFlow
Type of the OAuth flow.
Definition OAuthClientConfiguration.h:22
static std::string flowToString(const enum OAuthFlow flow)
Converts the flow to a string representation.
Definition OAuthClientConfiguration.h:63
static enum OAuthFlow stringToFlow(const std::string &string)
Parses string representation of a flow.
Definition OAuthClientConfiguration.h:78
OAuth services.
Definition AccessTokenRequestAuthenticator.h:8
Root for classes, functions and globals of 10Duke C++ Client.
Definition BackendConfiguration.h:7