oxdperl
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/OxdPackages/GetClientToken.pm view on Meta::CPAN
return $self->{_response_access_token};
}
# @return int
sub getResponseExpiresIn {
my( $self ) = @_;
$self->{_response_expires_in} = $self->getResponseData()->{expires_in};
return $self->{_response_expires_in};
}
# @return string
sub getResponseRefreshToken {
my( $self ) = @_;
$self->{_response_refresh_token} = $self->getResponseData()->{refresh_token};
return $self->{_response_refresh_token};
}
# @return string
sub getResponseScope {
my( $self ) = @_;
$self->{_response_scope} = $self->getResponseData()->{scope};
return $self->{_response_scope};
}
# Protocol command to oxd server
# @return void
sub setCommand{
# my $command = 'get_client_token';
my ( $self, $command ) = @_;
$self->{_command} = 'get_client_token';
return $self->{_command};
#return $command;
}
# Protocol command to oxd to http server
# @return void
sub sethttpCommand{
# my $httpCommand = 'get-client-token';
my ( $self, $httpCommand ) = @_;
$self->{_httpcommand} = 'get-client-token';
return $self->{_httpcommand};
#return $httpcommand;
}
# Method: setParams
# This method sets the parameters for get_client_token command.
# This module uses `request` method of OxdClient module for sending request to oxd-server
#
# Parameters:
#
# string $client_id - (Required) Client Id from Client registration
#
# string $client_secret - (Required) Client Secret. Must be used together with ClientId.
#
# string $op_host - (Required) Url that must points to a valid OpenID Connect Provider that supports client registration like Gluu Server.
#
# string $op_discovery_path - (Optional) Path to discovery document
#
# array $scope - (Optional) Scope
#
# string $authentication_method - (Optional) If value is missed then basic authentication is used. Otherwise it's possible to set `private_key_jwt` value for Private Key authentication.
#
# string $algorithm - (Optional) Required if authentication_method=private_key_jwt. Valid values are none, HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512
#
# string $key_id - (Optional) Required if authentication_method=private_key_jwt. It has to be valid key id from key store.
#
# Returns:
# void
#
# This module uses `getResponseObject` method of OxdClient module for getting response from oxd.
#
# *Example response from getResponseObject:*
# --- Code
# { "status": "ok", "data": { "access_token": "7ec389c5-64f8-49a3-a80c-e3e16d134bcb", "expires_in": 299, "refresh_token": null, "scope": "openid" } }
# ---
#
sub setParams{
my ( $self, $params ) = @_;
#use Data::Dumper;
my $paramsArray = {
"client_id"=> $self->getRequestClientId(),
"client_secret"=> $self->getRequestClientSecret(),
"op_host" => $self->getRequestOpHost(),
"op_discovery_path" => $self->getRequestOpDiscoveryPath(),
"scope" => $self->getRequestScope(),
"authentication_method" => $self->getRequestAuthenticationMethod(),
"algorithm" => $self->getRequestAlgorithm(),
"key_id" => $self->getRequestKeyId()
};
$self->{_params} = $paramsArray;
return $self->{_params};
#print Dumper( $params );
#return $paramsArray;
}
1; # this 1; is neccessary for our class to work
view all matches for this distributionview release on metacpan - search on metacpan
( run in 1.424 second using v1.00-cache-2.02-grep-82fe00e-cpan-2cc899e4a130 )