Returns the client_id to use in OAuth requests.

@param params  the request parameters.
@param options the request options.
@return the client_id.
975737
private static String getClientId(Map<String, Object> params, RequestOptions options)
      throws AuthenticationException {
    String clientId = Stripe.clientId;
    if ((options != null) && (options.getClientId() != null)) {
      clientId = options.getClientId();
    }
    if ((params != null) && (params.get("client_id") != null)) {
      clientId = (String) params.get("client_id");
    }

    if (clientId == null) {
      throw new AuthenticationException(
          "No client_id provided. (HINT: set client_id key using 'Stripe.clientId = <CLIENT-ID>'. "
              + "You can find your client_ids in your Stripe dashboard at "
              + "https://dashboard.stripe.com/account/applications/settings, "
              + "after registering your account as a platform. See "
              + "https://stripe.com/docs/connect/standard-accounts for details, "
              + "or email support@stripe.com if you have any questions.",
          null, null, 0);
    }

    return clientId;
  }
556141
public function requestClientCredentials($options = array()) {
        $options = array_merge(array(
            'scope' => '',
        ), $options);

        $res = $this->sendRequest('POST', $this->getUrl('oauth', 'token'), array(
            'client_id' => $this->getClientId(),
            'client_secret' => $this->getClientSecret(),
            'grant_type' => 'client_credentials',
            'scope' => $options['scope'],
        ));
        $result = $res->getBody();

        $token = null;
        if ($result && $result = json_decode($result, true)) {
            if (!empty($result['error'])) {
                throw new Exception($result['error_description']);
            }

            if (!empty($result['access_token'])) {
                $this->accessToken = $token = $result['access_token'];
            }
        }

        if (empty($token)) {
            throw new InvalidTokenException('token not available.');
        }

        return $token;
    }
358221
protected String doSign(final Map<String, String> params) {
        StringBuilder signing = new StringBuilder();

        for (Map.Entry<String, String> entry : params.entrySet()) {
            if (!Strings.isNullOrEmpty(entry.getValue())){
                signing.append(entry.getKey()).append('=').append(entry.getValue()).append("&");
            }
        }

        // append key
        signing.append("key=").append(wepay.getAppKey());

        // md5
        return MD5.generate(signing.toString(), false).toUpperCase();
    }
593665
private function _get_id_from_user(string $request, $params): ?string
  {
    if ( $this->id_user && $this->check() ){
      $sql = '
        SELECT `o`.`id`
        FROM bbn_observers AS `o`
          LEFT JOIN bbn_observers AS `ro`
            ON `o`.`id_alias` = `ro`.`id`
        WHERE `o`.`id_user` = ?
        AND (
          (
            `o`.`request` LIKE ?
            AND `o`.`params` '.($params ? 'LIKE ?' : 'IS NULL').'
          )
          OR (
            `ro`.`request` LIKE ?
            AND `ro`.`params` '.($params ? 'LIKE ?' : 'IS NULL').'
          )
        )';
       $args = [hex2bin($this->id_user), $request, $request];
       if ( $params ){
         array_splice($args, 2, 0, $params);
         array_push($args, $params);
       }
       return $this->db->get_one($sql, $args);
    }
    return null;
  }
764064
@Override
    public String getClientID() throws JMSRuntimeException {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "getClientID");

        String clientId = null;
        try {
            clientId = jmsConnection.getClientID();
        } catch (JMSException jmse) {
            throw (JMSRuntimeException) JmsErrorUtils.getJMS2Exception(jmse, JMSRuntimeException.class);
        } finally {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(this, tc, "getClientID", new Object[] { clientId });
        }

        return clientId;
    }
675252
public OAuth2Request createOAuth2Request(Map<String, String> parameters) {
		return new OAuth2Request(parameters, getClientId(), authorities, approved, getScope(), resourceIds,
				redirectUri, responseTypes, extensions);
	}
9061
private function _get_id(string $request, $params): ?string
  {
    if ( $this->check() ){
      if ( $params ){
        return $this->db->select_one('bbn_observers', 'id', [
          'id_string' => $this->_get_id_string($request, $params)
        ]);
      }
      return $this->db->get_one("
        SELECT id
        FROM bbn_observers
        WHERE `request` LIKE ?
        AND `params` IS NULL
        AND `public` = 1",
        $request);
    }
    return null;
  }
1141121
public static String authorizeUrl(Map<String, Object> params, RequestOptions options)
      throws AuthenticationException, InvalidRequestException {
    final String base = Stripe.getConnectBase();

    params.put("client_id", getClientId(params, options));
    if (params.get("response_type") == null) {
      params.put("response_type", "code");
    }
    String query;
    try {
      query = LiveStripeResponseGetter.createQuery(params);
    } catch (UnsupportedEncodingException e) {
      throw new InvalidRequestException("Unable to encode parameters to "
          + ApiResource.CHARSET
          + ". Please contact support@stripe.com for assistance.",
          null, null, null, 0, e);
    }

    String url = base + "/oauth/authorize?" + query;
    return url;
  }
51682
def find!(client, options = {})
      @client = client # so we can use client.logger in rescue
      raise ArgumentError, 'No :id given' unless options[:id]

      path = api_url(options) + "/#{options[:id]}"

      response = client.make_request!(path, :get)

      new(@client).tap do |resource|
        resource.attributes.merge!(options)
        resource.handle_response(response)
      end
    end
668785
def check_signature(params):
    
    if 'id' in params:
        try:
            id_int = int(params['id'][0])
        except:
            my_log_message(args, syslog.LOG_INFO, "Non-numerical client id (%s) in request." % (params['id'][0]))
            return False, None
        key = client_ids.get(id_int)
        if key:
            if 'h' in params:
                sig = params['h'][0]
                good_sig = make_signature(params, key)
                if sig == good_sig:
                    #my_log_message(args, syslog.LOG_DEBUG, "Good signature (client id '%i')" % id_int)
                    return True, key
                else:
                    my_log_message(args, syslog.LOG_INFO, "Bad signature from client id '%i' (%s, expected %s)." \
                                       % (id_int, sig, good_sig))
            else:
                my_log_message(args, syslog.LOG_INFO, "Client id (%i) but no HMAC in request." % (id_int))
                return False, key
        else:
            my_log_message(args, syslog.LOG_INFO, "Unknown client id '%i'" % (id_int))
            return False, None
    return True, None
229216
public static ClientOptions of(ClientOptions baseOptions, ClientOptionValue<?>... options) {
        // TODO(trustin): Reduce the cost of creating a derived ClientOptions.
        requireNonNull(baseOptions, "baseOptions");
        requireNonNull(options, "options");
        if (options.length == 0) {
            return baseOptions;
        }
        return new ClientOptions(baseOptions, options);
    }
1026665
protected int getAccessTokenValiditySeconds(OAuth2Request clientAuth) {
		if (clientDetailsService != null) {
			ClientDetails client = clientDetailsService.loadClientByClientId(clientAuth.getClientId());
			Integer validity = client.getAccessTokenValiditySeconds();
			if (validity != null) {
				return validity;
			}
		}
		return accessTokenValiditySeconds;
	}
482069
def find_by_id(self, project, params={}, **options): 
        
        path = "/projects/%s" % (project)
        return self.client.get(path, params, **options)
1138840
function(params) {

                corbel.validate.value('id', this.id);

                var options = params ? corbel.utils.clone(params) : {};

                var args = corbel.utils.extend(options, {
                    url: this._buildUriWithDomain(this.id),
                    method: corbel.request.method.GET,
                    query: params ? corbel.utils.serializeParams(params) : null
                });

                return this.request(args);

            }
395336
private String _getIdFromClientId(String clientId)
  {
    final char separator = getFacesContext().getNamingContainerSeparatorChar();
    int lastIndex = clientId.lastIndexOf(separator);

    String id = null;

    if (lastIndex < 0)
    {
      id = clientId;
    }
    else if (lastIndex < (clientId.length() - 1))
    {
      id = clientId.substring(lastIndex + 1);              
    }
    //else
    //{
      // TODO log warning for trailing colon case
    //}
 
    return id;
  }
96718
function(req) {

    return req.options.id || ( req.options.where && req.options.where.id ) || req.allParams()['id'];
  }
1009189
public String getAccessId() {
		String accessId = getAsNullableString("access_id");
		accessId = accessId != null ? accessId : getAsNullableString("client_id");
		return accessId;
	}