def userinfo_claims_only_specified_when_access_token_is_issued(authentication_request):
    """
    According to <a href="http://openid.net/specs/openid-connect-core-1_0.html#ClaimsParameter">
    "OpenID Connect Core 1.0", Section 5.5</a>: "When the userinfo member is used, the request MUST
    also use a response_type value that results in an Access Token being issued to the Client for
    use at the UserInfo Endpoint."
    :param authentication_request: the authentication request to verify
    :raise InvalidAuthenticationRequest: if the requested claims can not be returned according to the request
    """
    will_issue_access_token = authentication_request['response_type'] != ['id_token']
    contains_userinfo_claims_request = 'claims' in authentication_request and 'userinfo' in authentication_request[
        'claims']
    if not will_issue_access_token and contains_userinfo_claims_request:
        raise InvalidAuthenticationRequest('Userinfo claims cannot be requested, when response_type=\'id_token\'',
                                           authentication_request,
                                           oauth_error='invalid_request')
According to <a href="http://openid.net/specs/openid-connect-core-1_0.html#ClaimsParameter">
    "OpenID Connect Core 1.0", Section 5.5</a>: "When the userinfo member is used, the request MUST
    also use a response_type value that results in an Access Token being issued to the Client for
    use at the UserInfo Endpoint."
    :param authentication_request: the authentication request to verify
    :raise InvalidAuthenticationRequest: if the requested claims can not be returned according to the request