Kernel::System::AccessToken::Storage::OIDC

NAME

Kernel::System::AccessToken::Storage::OIDC

DESCRIPTION

Authorization tokens database storage class.

PUBLIC INTERFACE

Decode()

Decode a jwt-token.

    my $TokenData = $AccessTokenObject->Decode(
        Token => '...' # jwt-token

        # claims (optional)
        VerifyIss => '',
        VerifyAud => '',
        VerifyExp => 0,
    );

Returns

    C<undef> - in case any error occurs
    hashref  - token data

GetUserOnToken()

Returns the username that the token belongs to.

    my $UserLogin = $Self->GetUserOnToken(
        DecodedToken => { ... }     # decoded token
    );

Update()

Update access tokens (no-op when OIDC is used).

    # update create-time of all access tokens.
    my $Result = $Storage->Update(Data => {CreateTime => '2018-03-02'});

    # update last-access-time and create-time off all the access tokens for user-id X.
    my $Result = $Storage->Update(
        Filters => {UserID => 'X'},
        Data    => {LastAccessTime => '2018-03-02', CreateTime => '2018-03-01'}
    );

    # update last-access-time for uuid X.
    my $Result = $Storage->Update(
        Filters => {UUID           => 'X'},
        Data    => {LastAccessTime => '2018-04-01'},
    );

Returns

    1 - in case of success.

PRIVATE METHODS

_IsAgent()

Returns true is user type is agent.

_IsCustomer()

Returns true is user type is customer.

_ActiveUsers()

Get the active OIDC users and enhance them with the OTRS internal id.

_MatchFilters()

Verifies if the user session matches the filters.

    my $Match = $Self->_MatchFilters(
        Filters => {...},
        Row     => {...},
    );

Returns

    1     - match
    undef - no match

_FilterList()

Filters the users sessions.

    my $FilteredList = $Self->_FilterList(
        List    => [...],
        Filters => {...},
    );

_SortList()

Sorts the users sessions.

    my $SortedList = $Self->_SortList(
        List    => [...],
        SortBy  => '...',
    );

_CacheType()

Returns the cache type.

Scroll to Top