NAME
Kernel::System::Credential::Base – Base class for credential modules
ATTRIBUTES
ID
Unique identifier for credential entries.
Name
Human readable name for credential entries.
ValidID
Attribute that holds the valid id.
CreateTime
Attribute that holds record create date-time.
CreateTime
Attribute that holds record create by.
ChangeTime
Attribute that holds record change date-time.
ChangeBy
Attribute that holds record change by.
Payload
Provides the credential data, that is used to authorize against resource owners.
METHODS
BUILDARGS()
Unpack the Config
parameter to the normal attributes if given.
Type()
Returns the credential type.
Label()
Returns the credential type label.
GroupLabel()
Returns the credential group type label.
TypeLabel()
Returns the credential type label.
Verify()
Verifies the current state of the credential.
PayloadList
Provides a list of keys, that can be used to retrieve certain credential data.
my $PayloadList = $BasicAuth->PayloadList();
Returns
[
Username,
Password,
]
PayloadGet
Expects a payload key and returns the corresponding value.
my $Username = $BasicAuth->PayloadGet('Username');
Returns the corresponding value for a given key and undef in case of wrong keys or missing data.
ToHash()
Returns the credential configuration information in a HashRef
.
my $HashRef = $AuthCredential->ToHash();
Returns
{
ID => 123,
Name => 'MyAuthData',
Type => 'BasicAuth',
Config => {
Username => 'myuser',
Password => 'supersecret',
},
ValidID => 1,
CreateTime => '2021-07-02 09:30:30',
CreateBy => 234,
ChangeTime => '2021-07-02 09:30:30',
ChangeBy => 234,
}
Config()
Retuns the credential configuration.
CanRefresh
Checks if the credential authorization can be refreshed.
Refresh()
Refresh the credential authorization.
NeedsAuthorization()
Indicates if the credential needs authorization.
NeedsAuthorizationConsent()
Verifies if the credential is presently in a state that needs the user consent to get the authorization token.
IsValid()
Indicates if the credential is classified as valid or not.
my $IsValid = $AuthCredential->IsValid();
Returns
1 - valid
0 - invalid (any kind of invalid)
CanRefreshBeforeExpireSeconds()
Indicates how many seconds before the credential can be refreshed before expires.
my $Seconds = $AuthCredential->CanRefreshBeforeExpireSeconds();