function withGrant($grantTypeName, array $overrideOptions = [])
    {
        $options = [
            'scopes'        => $this->defaultScopes,
            'client_id'     => $this->clientId,
            'client_secret' => $this->clientSecret,
        ];

        if (! empty($overrideOptions) )
            $options = array_merge($options, $overrideOptions);


        if ($grantTypeName instanceof ipGrantRequest) {
            $grant = clone $grantTypeName;
            $grant->with($grant::parseWith($options));
        } else {
            $grant = $this->plugins()->fresh($grantTypeName, $options);
        }

        return $grant;
    }
function withGrant($grantTypeName, array $overrideOptions = [])
    {
        $options = [
            'scopes'        => $this->defaultScopes,
            'client_id'     => $this->clientId,
            'client_secret' => $this->clientSecret,
        ];

        if (! empty($overrideOptions) )
            $options = array_merge($options, $overrideOptions);


        if ($grantTypeName instanceof ipGrantRequest) {
            $grant = clone $grantTypeName;
            $grant->with($grant::parseWith($options));
        } else {
            $grant = $this->plugins()->fresh($grantTypeName, $options);
        }

        return $grant;
    }
function withGrant ( $ grantTypeName , array $ overrideOptions = [ ] ) { $ options = [ 'scopes' => $ this -> defaultScopes , 'client_id' => $ this -> clientId , 'client_secret' => $ this -> clientSecret , ] ; if ( ! empty ( $ overrideOptions ) ) $ options = array_merge ( $ options , $ overrideOptions ) ; if ( $ grantTypeName instanceof ipGrantRequest ) { $ grant = clone $ grantTypeName ; $ grant -> with ( $ grant :: parseWith ( $ options ) ) ; } else { $ grant = $ this -> plugins ( ) -> fresh ( $ grantTypeName , $ options ) ; } return $ grant ; }
Retrieve Specific Grant Type

- inject default client configuration within grant object

example code:

$auth->withGrant(
GrantPlugins::AUTHORIZATION_CODE
, ['state' => 'custom_state'] )

@param string|ipGrantRequest $grantTypeName
@param array                 $overrideOptions

@return aGrantRequest
Retrieve Specific Grant Type