/** * Calls {@code clientBuilder.setApiKey(ApiKeys.builder().}{@link com.stormpath.sdk.api.ApiKeyBuilder#setFileLocation(String) setFileLocation(apiKeyFileLocation)}{@code .build())}. * See that JavaDoc for expected syntax/format. * * @param apiKeyFileLocation the file, classpath or url location of the API Key {@code .properties} file to load when * constructing the API Key to use for communicating with the Stormpath REST API. * @see ClientBuilder#setApiKey(com.stormpath.sdk.api.ApiKey) * @see com.stormpath.sdk.api.ApiKeyBuilder#setFileLocation(String) * @since 0.2 */ public void setApiKeyFileLocation(String apiKeyFileLocation) { this.clientBuilder.setApiKey(ApiKeys.builder().setFileLocation(apiKeyFileLocation).build()); }
/** * Calls {@code clientBuilder.setApiKey(ApiKeys.builder().}{@link com.stormpath.sdk.api.ApiKeyBuilder#setFileLocation(String) setFileLocation(apiKeyFileLocation)}{@code .build())}. * See that JavaDoc for expected syntax/format. * * @param apiKeyFileLocation the file, classpath or url location of the API Key {@code .properties} file to load when * constructing the API Key to use for communicating with the Stormpath REST API. * @see ClientBuilder#setApiKey(com.stormpath.sdk.api.ApiKey) * @see com.stormpath.sdk.api.ApiKeyBuilder#setFileLocation(String) * @since 0.2 */ public void setApiKeyFileLocation(String apiKeyFileLocation) { this.clientBuilder.setApiKey(ApiKeys.builder().setFileLocation(apiKeyFileLocation).build()); }
/** * Calls {@code clientBuilder.setApiKey(ApiKeys.builder().}{@link com.stormpath.sdk.api.ApiKeyBuilder#setFileLocation(String) setFileLocation(apiKeyFileLocation)}{@code .build())}. * See that JavaDoc for expected syntax/format. * * @param apiKeyFileLocation the file, classpath or url location of the API Key {@code .properties} file to load when * constructing the API Key to use for communicating with the Stormpath REST API. * @see ClientBuilder#setApiKey(com.stormpath.sdk.api.ApiKey) * @see com.stormpath.sdk.api.ApiKeyBuilder#setFileLocation(String) * @since 0.2 */ public void setApiKeyFileLocation(String apiKeyFileLocation) { this.clientBuilder.setApiKey(ApiKeys.builder().setFileLocation(apiKeyFileLocation).build()); }
@Override @SuppressWarnings("PMD.NPathComplexity") protected ApiKey createApiKey() { ApiKeyBuilder apiKeyBuilder = ApiKeys.builder(); Config config = getConfig(); String value = Strings.hasText(apiKeyId) ? apiKeyId : config.get("stormpath.client.apiKey.id"); if (Strings.hasText(value)) { apiKeyBuilder.setId(value); } //check for API Key ID embedded in the properties configuration value = Strings.hasText(apiKeySecret) ? apiKeySecret : config.get("stormpath.client.apiKey.secret"); if (Strings.hasText(value)) { apiKeyBuilder.setSecret(value); } value = Strings.hasText(apiKeyFileLocation) ? apiKeyFileLocation : config.get(STORMPATH_API_KEY_FILE); if (Strings.hasText(value)) { apiKeyBuilder.setFileLocation(value); } return apiKeyBuilder.build(); }
protected ApiKey createApiKey() { if (isOktaEnabled()) { String oktaToken = config.get("okta.api.token"); Assert.hasText(oktaToken, "'okta.api.token' is required when 'okta.enable' is true"); // TODO: duplicate code from spring config return new DefaultPairedApiKey(new ClientApiKey("okta_api_token", oktaToken)); } else { ApiKeyBuilder apiKeyBuilder = ApiKeys.builder(); String value = config.get("stormpath.client.apiKey.id"); if (Strings.hasText(value)) { apiKeyBuilder.setId(value); } //check for API Key ID embedded in the properties configuration value = config.get("stormpath.client.apiKey.secret"); if (Strings.hasText(value)) { apiKeyBuilder.setSecret(value); } value = config.get(STORMPATH_API_KEY_FILE); if (Strings.hasText(value)) { apiKeyBuilder.setFileLocation(value); } return apiKeyBuilder.build(); } }
protected ApiKey createApiKey() { if (isOktaEnabled()) { String oktaToken = config.get("okta.api.token"); Assert.hasText(oktaToken, "'okta.api.token' is required when 'okta.enable' is true"); // TODO: duplicate code from spring config return new DefaultPairedApiKey(new ClientApiKey("okta_api_token", oktaToken)); } else { ApiKeyBuilder apiKeyBuilder = ApiKeys.builder(); String value = config.get("stormpath.client.apiKey.id"); if (Strings.hasText(value)) { apiKeyBuilder.setId(value); } //check for API Key ID embedded in the properties configuration value = config.get("stormpath.client.apiKey.secret"); if (Strings.hasText(value)) { apiKeyBuilder.setSecret(value); } value = config.get(STORMPATH_API_KEY_FILE); if (Strings.hasText(value)) { apiKeyBuilder.setFileLocation(value); } return apiKeyBuilder.build(); } }