1#ifndef TENDUKE_OAUTH_OAUTHCLIENTCONFIGURATION_H
2#define TENDUKE_OAUTH_OAUTHCLIENTCONFIGURATION_H
4#include "crypto/PublicKey.h"
69 case PKCE:
return "PKCE";
70 case DEVICE:
return "DEVICE";
71 default:
return "UNKNOWN";
82 if (
"DEVICE" ==
string) {
83 return OAuthFlow::DEVICE;
85 if (
"PKCE" ==
string) {
86 return OAuthFlow::PKCE;
88 return OAuthFlow::UNKNOWN;
110 this->oauthClientId = pClientId;
121 this->oauthRedirectURI = pRedirectURI;
132 this->oauthClientSecret = pClientSecret;
152 std::string oauthClientId;
154 std::string oauthClientSecret;
156 std::string oauthRedirectURI;
167 return Builder(OAuthFlow::PKCE);
Builder for the configuration.
Definition OAuthClientConfiguration.h:95
Builder & clientSecret(const std::string &pClientSecret)
Fluently sets client secret.
Definition OAuthClientConfiguration.h:130
Builder & clientId(const std::string &pClientId)
Fluent sets the OAuth client id.
Definition OAuthClientConfiguration.h:108
Builder(const OAuthFlow flow)
Constructs new instance.
Definition OAuthClientConfiguration.h:101
OAuthClientConfiguration build()
Builds the configuration.
Definition OAuthClientConfiguration.h:140
Builder & redirectURI(const std::string &pRedirectURI)
Fluently sets redirect URI.
Definition OAuthClientConfiguration.h:119
Container for OAuth-client-configuration.
Definition OAuthClientConfiguration.h:17
enum OAuthFlow flow
The flow.
Definition OAuthClientConfiguration.h:57
const std::string clientSecret
(Optional) OAuth 2 client secret, configured also in the server.
Definition OAuthClientConfiguration.h:52
static Builder forPKCEFlow()
Starts building configuration for PKCE-flow.
Definition OAuthClientConfiguration.h:165
const std::string clientId
OAuth 2 client id, configured also in the server.
Definition OAuthClientConfiguration.h:50
const std::string redirectURI
OAuth2 redirect-URI for browser-based based authentication.
Definition OAuthClientConfiguration.h:54
OAuthClientConfiguration(std::string clientId, std::string clientSecret, std::string redirectURI, const enum OAuthFlow flow)
Constructs new instance.
Definition OAuthClientConfiguration.h:38
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:65
static enum OAuthFlow stringToFlow(const std::string &string)
Parses string representation of a flow.
Definition OAuthClientConfiguration.h:80
OAuth services.
Definition AccessTokenRequestAuthenticator.h:8
Root for classes, functions and globals of 10Duke C++ Client.
Definition APIRequest.h:4