10Duke Enterprise C++ SDK
Loading...
Searching...
No Matches
ROPGAuthenticationConfig.h
1#ifndef TENDUKE_OIDC_ROPG_ROPGAUTHENTICATIONCONFIG_H
2#define TENDUKE_OIDC_ROPG_ROPGAUTHENTICATIONCONFIG_H
3
4#include "../BaseOIDCAuthenticationConfig.h"
5#include "oauth/ropg/ResourceOwnerPasswordCredentialsProvider.h"
6#include <cstdint>
7
8namespace tenduke { namespace oidc { namespace ropg {
9
10class ROPGAuthenticationConfig : public BaseOIDCAuthenticationConfig
11{
12public:
13 static constexpr std::uint32_t DEFAULT_LOGIN_ATTEMPTS = 0;
14 static constexpr std::uint32_t UNLIMITED_LOGIN_ATTEMPTS = UINT32_MAX;
15
16public:
29 const ::tenduke::oauth::ropg::ResourceOwnerPasswordCredentialsProvider &credentialsProvider,
30 std::string oauthClientId,
31 std::string oauthClientSecret = {},
32 const std::uint32_t maxLoginAttempts = DEFAULT_LOGIN_ATTEMPTS,
34 std::string scopes = {},
35 std::map<std::string, std::string> attributes = {}
36 ) : BaseOIDCAuthenticationConfig(
37 std::move(oauthClientId),
38 std::move(oauthClientSecret),
39 std::move(oidcSessionConfiguration),
40 std::move(scopes),
41 std::move(attributes)
42 )
43 , credentialsProvider(credentialsProvider)
44 , maxLoginAttempts(maxLoginAttempts)
45 {}
46
51 std::uint32_t getMaxLoginAttempts() const
52 {
53 return (maxLoginAttempts == DEFAULT_LOGIN_ATTEMPTS ? UNLIMITED_LOGIN_ATTEMPTS : maxLoginAttempts);
54 }
55
56public:
57 const ::tenduke::oauth::ropg::ResourceOwnerPasswordCredentialsProvider &credentialsProvider;
58 const std::uint32_t maxLoginAttempts;
59};
60
61}}}
62
63#endif //TENDUKE_OIDC_ROPG_ROPGAUTHENTICATIONCONFIG_H
ROPGAuthenticationConfig(const ::tenduke::oauth::ropg::ResourceOwnerPasswordCredentialsProvider &credentialsProvider, std::string oauthClientId, std::string oauthClientSecret={}, const std::uint32_t maxLoginAttempts=DEFAULT_LOGIN_ATTEMPTS, ::tenduke::oidc::OIDCSessionConfiguration oidcSessionConfiguration={}, std::string scopes={}, std::map< std::string, std::string > attributes={})
Creates a new instance.
Definition ROPGAuthenticationConfig.h:28
const std::map< std::string, std::string > attributes
Custom attributes.
Definition BaseOIDCAuthenticationConfig.h:45
const std::string oauthClientId
OAuth client id.
Definition BaseOIDCAuthenticationConfig.h:31
const std::string scopes
OAuth/OIDC scopes to authorize.
Definition BaseOIDCAuthenticationConfig.h:42
const std::string oauthClientSecret
OAuth client secret.
Definition BaseOIDCAuthenticationConfig.h:36
const ::tenduke::oidc::OIDCSessionConfiguration oidcSessionConfiguration
OIDC session configuration.
Definition BaseOIDCAuthenticationConfig.h:39
Configuration for tenduke::oidc::OIDCSessionImpl.
Definition OIDCSessionConfiguration.h:16
ROPGAuthenticationConfig(const ::tenduke::oauth::ropg::ResourceOwnerPasswordCredentialsProvider &credentialsProvider, std::string oauthClientId, std::string oauthClientSecret={}, const std::uint32_t maxLoginAttempts=DEFAULT_LOGIN_ATTEMPTS, ::tenduke::oidc::OIDCSessionConfiguration oidcSessionConfiguration={}, std::string scopes={}, std::map< std::string, std::string > attributes={})
Creates a new instance.
Definition ROPGAuthenticationConfig.h:28
std::uint32_t getMaxLoginAttempts() const
Returns maximum number of login attempts.
Definition ROPGAuthenticationConfig.h:51
Implementation of OpenID Connect protocol.
Definition AutoDiscovery.h:15
Root for classes, functions and globals of 10Duke C++ Client.
Definition APIRequest.h:4