#include <virtru_credentials_oidc.h>
|
| CredentialsOidc (const std::string &owner, const std::string &clientId, const std::string &clientSecret, const std::string &clientPubkey, const std::string &organizationName, const std::string &oidcEndpoint) |
|
| CredentialsOidc (const std::string &owner, const std::string &refreshToken, const std::string &clientPubkey, const std::string &organizationName, const std::string &oidcEndpoint) |
|
| CredentialsOidc (const std::string &userId, const OIDCHeaders &headers) |
|
| CredentialsOidc (const std::string &userId, const std::string &authorizationString, const std::string &clientToken) |
|
virtual std::unique_ptr
< Credentials > | clone () const |
|
virtual | ~CredentialsOidc () |
|
virtual OIDCHeaders | generateAuthHeaders (const std::string &url, const std::string &method, const std::string &body, const std::map< std::string, std::string > &headers, const std::string &date) |
|
virtual std::string | getUserId () const |
|
virtual std::string | str () const |
|
void | setHTTPServiceProvider (std::weak_ptr< INetwork > httpServiceProvider) |
|
std::string | getAccessToken () |
|
CredentialsType | getType () const |
|
std::string | getTypeStr () const |
|
|
std::map< std::string,
std::string > | parseUrlTODO (const std::string &url) const |
|
|
std::tuple< std::string,
std::string > | exchangeCredentials (const std::string &clientId, const std::string &clientSecret) const |
|
std::tuple< std::string,
std::string > | exchangeRefresh (const std::string &refreshToken) const |
|
std::tuple< std::string,
std::string > | userInfo (const std::string &accessToken) const |
|
std::shared_ptr< INetwork > | getHTTPServiceProvider () const |
|
virtru::CredentialsOidc::CredentialsOidc |
( |
const std::string & |
owner, |
|
|
const std::string & |
clientId, |
|
|
const std::string & |
clientSecret, |
|
|
const std::string & |
clientPubkey, |
|
|
const std::string & |
organizationName, |
|
|
const std::string & |
oidcEndpoint |
|
) |
| |
Constructor
- Parameters
-
owner | - Ignored, redundant, kept for backward compatibility |
clientId | - The OIDC clientcredential client id |
clientSecret | - The OIDC clientcredential client secret |
clientPubKey | - The client public key, which will be forwarded to the IdP |
organizationName | - The org/realm mapped to this client in the IdP |
oidcEndpoint | - The OIDC IdP endpoint to request tokens from |
virtru::CredentialsOidc::CredentialsOidc |
( |
const std::string & |
owner, |
|
|
const std::string & |
refreshToken, |
|
|
const std::string & |
clientPubkey, |
|
|
const std::string & |
organizationName, |
|
|
const std::string & |
oidcEndpoint |
|
) |
| |
Constructor
- Parameters
-
owner | - Ignored, redundant, kept for backward compatibility |
refreshToken | - A valid OIDC refresh token as previously issued by 'oidcEndpoint' - this will be exchanged for an access token with updated Virtru claims |
clientPubKey | - The client public key, which will be forwarded to the IdP |
organizationName | - The org/realm mapped to this client in the IdP |
oidcEndpoint | - The OIDC IdP endpoint to request tokens from |
virtru::CredentialsOidc::CredentialsOidc |
( |
const std::string & |
userId, |
|
|
const OIDCHeaders & |
headers |
|
) |
| |
Constructor
- Parameters
-
userId | - The user id. |
header | - The headers that are used when communicating with the auth server |
virtru::CredentialsOidc::CredentialsOidc |
( |
const std::string & |
userId, |
|
|
const std::string & |
authorizationString, |
|
|
const std::string & |
clientToken |
|
) |
| |
Constructor
- Parameters
-
userId | - The userId associated with the token |
authorizationString | - The auth string to be used |
clientToken | - A valid OIDC token as previously issued |
virtual virtru::CredentialsOidc::~CredentialsOidc |
( |
| ) |
|
|
virtual |
virtual std::unique_ptr<Credentials> virtru::CredentialsOidc::clone |
( |
| ) |
const |
|
virtual |
Create a new instance of this object
- Returns
- - The new instance
Reimplemented from virtru::Credentials.
std::tuple<std::string, std::string> virtru::CredentialsOidc::exchangeCredentials |
( |
const std::string & |
clientId, |
|
|
const std::string & |
clientSecret |
|
) |
| const |
|
private |
std::tuple<std::string, std::string> virtru::CredentialsOidc::exchangeRefresh |
( |
const std::string & |
refreshToken | ) |
const |
|
private |
virtual OIDCHeaders virtru::CredentialsOidc::generateAuthHeaders |
( |
const std::string & |
url, |
|
|
const std::string & |
method, |
|
|
const std::string & |
body, |
|
|
const std::map< std::string, std::string > & |
headers, |
|
|
const std::string & |
date |
|
) |
| |
|
virtual |
Create the header key/value pairs that should be added to the request to establish authorization
- Parameters
-
url | - The full url for the request, including protocol prefix and parameter information |
method | - The method for the request, such as 'get' or 'post' |
body | - The body for the request, can be an empty string if there is no body content |
headers | - a set of http header key/value pairs that should be included in calculations |
date | - the date string that should be used in calculations |
- Returns
- - map of key/value http header pairs
Reimplemented from virtru::Credentials.
std::string virtru::CredentialsOidc::getAccessToken |
( |
| ) |
|
Get the access token associated with these credentials
- Returns
- - The access token as a string
std::shared_ptr<INetwork> virtru::CredentialsOidc::getHTTPServiceProvider |
( |
| ) |
const |
|
private |
Get the type of this credentials object, as specified by the CredentialsType enum value
- Returns
- - The type enum value of this credentials instance
std::string virtru::Credentials::getTypeStr |
( |
| ) |
const |
|
inherited |
Get the type of this credentials object, as a string representation of the CredentialsType
- Returns
- - The type of this credentials instance as a string
virtual std::string virtru::CredentialsOidc::getUserId |
( |
| ) |
const |
|
virtual |
std::map<std::string, std::string> virtru::Credentials::parseUrlTODO |
( |
const std::string & |
url | ) |
const |
|
protectedinherited |
void virtru::CredentialsOidc::setHTTPServiceProvider |
( |
std::weak_ptr< INetwork > |
httpServiceProvider | ) |
|
virtual std::string virtru::CredentialsOidc::str |
( |
| ) |
const |
|
virtual |
Get a debug-friendly string describing this credentials object
- Returns
- - The type of this credentials instance as a string
Reimplemented from virtru::Credentials.
std::tuple<std::string, std::string> virtru::CredentialsOidc::userInfo |
( |
const std::string & |
accessToken | ) |
const |
|
private |
std::string virtru::CredentialsOidc::m_clientId |
|
private |
std::string virtru::CredentialsOidc::m_clientPubkey |
|
private |
std::string virtru::CredentialsOidc::m_clientSecret |
|
private |
std::weak_ptr<INetwork> virtru::CredentialsOidc::m_networkServiceProvider |
|
private |
std::string virtru::CredentialsOidc::m_oidcEndpoint |
|
private |
std::string virtru::CredentialsOidc::m_orgName |
|
private |
std::string virtru::CredentialsOidc::m_owner |
|
private |
std::tuple<std::string, std::string> virtru::CredentialsOidc::m_tokens |
|
private |
The documentation for this class was generated from the following file: