rublon-ssh/PAM/ssh/include/rublon/authentication_step_interface.hpp
rublon-bwi 627ef2a6b4
Bwi/v2.0.3 (#11)
* Remove unused options from rublon default config

* Remove safe|secure options

* Allow 9 digits long passcode for passcode bypass

* Change name of 'Mobile Passcode' to 'Passcode'

* Do not display any prompt when user is waiting

* remove unused alloca.h header

* Add autopushPrompt option

* Change name OTP method

* Change enrolement message handling

* add static string ctor

* Addded postrm script

* [bugfix] Restart sshd service after rublon package instalation

* Rename 01_rublon_ssh.conf to 01-rublon-ssh.conf

* Prepared scripts for generating rpm for alma nad rocky

* Adding public key authentication option

* Add postinst script and ssh configuration for using pubkey

* Add GCC 7 compatybility

* Cleanup includes, cleanup std::array usage

* Add Static String implementation

* Remove memory_resources

* Add monotonic_buffer_resource in experimental c++ imlpementation

* Use case insensitive map

* Remove not needed code
2024-09-03 20:28:12 +02:00

35 lines
1.0 KiB
C++
Executable File

#pragma once
#include <rublon/core_handler_interface.hpp>
#include <rublon/pam_action.hpp>
#include <rublon/utils.hpp>
namespace rublon {
class AuthenticationStep {
protected:
std::string _systemToken;
std::string _tid;
public:
AuthenticationStep() = default;
AuthenticationStep(std::string systemToken, std::string tid) : _systemToken{std::move(systemToken)}, _tid{std::move(tid)} {}
protected:
void addSystemToken(Document & body) const {
auto & alloc = body.GetAllocator();
body.AddMember("systemToken", Value{this->_systemToken.c_str(), alloc}, alloc);
}
void addTid(Document & body) const {
auto & alloc = body.GetAllocator();
body.AddMember("tid", Value{this->_tid.c_str(), alloc}, alloc);
}
void addAccessToken(Document & body, std::string_view token) const {
auto & alloc = body.GetAllocator();
body.AddMember("accessToken", Value{token.data(), static_cast< unsigned >(token.length()), alloc}, alloc);
}
};
} // namespace rublon