/** * Calls {@code clientBuilder.setApiKey(ApiKeys.builder().}{@link com.stormpath.sdk.api.ApiKeyBuilder#setProperties(java.util.Properties) setProperties(properties)}{@code .build())}. * * @param properties the properties instance to use to load the API Key ID and Secret. * @see ClientBuilder#setApiKey(com.stormpath.sdk.api.ApiKey) * @see com.stormpath.sdk.api.ApiKeyBuilder#setProperties(java.util.Properties) * @since 0.2 */ public void setApiKeyProperties(Properties properties) { this.clientBuilder.setApiKey(ApiKeys.builder().setProperties(properties).build()); }
/** * Calls {@code clientBuilder.setApiKey(ApiKeys.builder().}{@link com.stormpath.sdk.api.ApiKeyBuilder#setInputStream(java.io.InputStream) setInputStream(apiKeyInputStream)}{@code .build())}. * * @param apiKeyInputStream the InputStream to use to construct a configuration Properties instance. * @see ClientBuilder#setApiKey(com.stormpath.sdk.api.ApiKey) * @see com.stormpath.sdk.api.ApiKeyBuilder#setInputStream(java.io.InputStream) * @since 0.2 */ public void setApiKeyInputStream(InputStream apiKeyInputStream) { this.clientBuilder.setApiKey(ApiKeys.builder().setInputStream(apiKeyInputStream).build()); }
/** * Calls {@code clientBuilder.setApiKey(ApiKeys.builder().}{@link com.stormpath.sdk.api.ApiKeyBuilder#setIdPropertyName(String) setIdPropertyName(apiKeyIdPropertyName)}{@code .build())}. * * @param apiKeyIdPropertyName the name used to query for the API Key ID from a Properties instance. * @see ClientBuilder#setApiKey(com.stormpath.sdk.api.ApiKey) * @see com.stormpath.sdk.api.ApiKeyBuilder#setIdPropertyName(String) * @since 0.2 */ public void setApiKeyIdPropertyName(String apiKeyIdPropertyName) { this.clientBuilder.setApiKey(ApiKeys.builder().setIdPropertyName(apiKeyIdPropertyName).build()); }
/** * Calls {@code clientBuilder.setApiKey(ApiKeys.builder().}{@link com.stormpath.sdk.api.ApiKeyBuilder#setSecretPropertyName(String) setSecretPropertyName(apiKeySecretPropertyName)}{@code .build())}. * * @param apiKeySecretPropertyName the name used to query for the API Key Secret from a Properties instance. * @see ClientBuilder#setApiKey(com.stormpath.sdk.api.ApiKey) * @see com.stormpath.sdk.api.ApiKeyBuilder#setSecretPropertyName(String) * @since 0.2 */ public void setApiKeySecretPropertyName(String apiKeySecretPropertyName) { this.clientBuilder.setApiKey(ApiKeys.builder().setSecretPropertyName(apiKeySecretPropertyName).build()); }
/** * Calls {@code clientBuilder.setApiKey(ApiKeys.builder().}{@link com.stormpath.sdk.api.ApiKeyBuilder#setInputStream(java.io.InputStream) setInputStream(apiKeyInputStream)}{@code .build())}. * * @param apiKeyInputStream the InputStream to use to construct a configuration Properties instance. * @see ClientBuilder#setApiKey(com.stormpath.sdk.api.ApiKey) * @see com.stormpath.sdk.api.ApiKeyBuilder#setInputStream(java.io.InputStream) * @since 0.2 */ public void setApiKeyInputStream(InputStream apiKeyInputStream) { this.clientBuilder.setApiKey(ApiKeys.builder().setInputStream(apiKeyInputStream).build()); }
/** * Calls {@code clientBuilder.setApiKey(ApiKeys.builder().}{@link com.stormpath.sdk.api.ApiKeyBuilder#setProperties(java.util.Properties) setProperties(properties)}{@code .build())}. * * @param properties the properties instance to use to load the API Key ID and Secret. * @see ClientBuilder#setApiKey(com.stormpath.sdk.api.ApiKey) * @see com.stormpath.sdk.api.ApiKeyBuilder#setProperties(java.util.Properties) * @since 0.2 */ public void setApiKeyProperties(Properties properties) { this.clientBuilder.setApiKey(ApiKeys.builder().setProperties(properties).build()); }
/** * Calls {@code clientBuilder.setApiKey(ApiKeys.builder().}{@link com.stormpath.sdk.api.ApiKeyBuilder#setReader(java.io.Reader) setReader(apiKeyReader)}{@code .build())}. * * @param apiKeyReader the reader to use to construct a configuration Properties instance. * @see ClientBuilder#setApiKey(com.stormpath.sdk.api.ApiKey) * @see com.stormpath.sdk.api.ApiKeyBuilder#setReader(java.io.Reader) * @since 0.2 */ public void setApiKeyReader(Reader apiKeyReader) { this.clientBuilder.setApiKey(ApiKeys.builder().setReader(apiKeyReader).build()); }
/** * Calls {@code clientBuilder.setApiKey(ApiKeys.builder().}{@link com.stormpath.sdk.api.ApiKeyBuilder#setSecretPropertyName(String) setSecretPropertyName(apiKeySecretPropertyName)}{@code .build())}. * * @param apiKeySecretPropertyName the name used to query for the API Key Secret from a Properties instance. * @see ClientBuilder#setApiKey(com.stormpath.sdk.api.ApiKey) * @see com.stormpath.sdk.api.ApiKeyBuilder#setSecretPropertyName(String) * @since 0.2 */ public void setApiKeySecretPropertyName(String apiKeySecretPropertyName) { this.clientBuilder.setApiKey(ApiKeys.builder().setSecretPropertyName(apiKeySecretPropertyName).build()); }
/** * Calls {@code clientBuilder.setApiKey(ApiKeys.builder().}{@link com.stormpath.sdk.api.ApiKeyBuilder#setReader(java.io.Reader) setReader(apiKeyReader)}{@code .build())}. * * @param apiKeyReader the reader to use to construct a configuration Properties instance. * @see ClientBuilder#setApiKey(com.stormpath.sdk.api.ApiKey) * @see com.stormpath.sdk.api.ApiKeyBuilder#setReader(java.io.Reader) * @since 0.2 */ public void setApiKeyReader(Reader apiKeyReader) { this.clientBuilder.setApiKey(ApiKeys.builder().setReader(apiKeyReader).build()); }
/** * Calls {@code clientBuilder.setApiKey(ApiKeys.builder().}{@link com.stormpath.sdk.api.ApiKeyBuilder#setIdPropertyName(String) setIdPropertyName(apiKeyIdPropertyName)}{@code .build())}. * * @param apiKeyIdPropertyName the name used to query for the API Key ID from a Properties instance. * @see ClientBuilder#setApiKey(com.stormpath.sdk.api.ApiKey) * @see com.stormpath.sdk.api.ApiKeyBuilder#setIdPropertyName(String) * @since 0.2 */ public void setApiKeyIdPropertyName(String apiKeyIdPropertyName) { this.clientBuilder.setApiKey(ApiKeys.builder().setIdPropertyName(apiKeyIdPropertyName).build()); }
/** * Calls {@code clientBuilder.setApiKey(ApiKeys.builder().}{@link com.stormpath.sdk.api.ApiKeyBuilder#setProperties(java.util.Properties) setProperties(properties)}{@code .build())}. * * @param properties the properties instance to use to load the API Key ID and Secret. * @see ClientBuilder#setApiKey(com.stormpath.sdk.api.ApiKey) * @see com.stormpath.sdk.api.ApiKeyBuilder#setProperties(java.util.Properties) * @since 0.2 */ public void setApiKeyProperties(Properties properties) { this.clientBuilder.setApiKey(ApiKeys.builder().setProperties(properties).build()); }
/** * Calls {@code clientBuilder.setApiKey(ApiKeys.builder().}{@link com.stormpath.sdk.api.ApiKeyBuilder#setReader(java.io.Reader) setReader(apiKeyReader)}{@code .build())}. * * @param apiKeyReader the reader to use to construct a configuration Properties instance. * @see ClientBuilder#setApiKey(com.stormpath.sdk.api.ApiKey) * @see com.stormpath.sdk.api.ApiKeyBuilder#setReader(java.io.Reader) * @since 0.2 */ public void setApiKeyReader(Reader apiKeyReader) { this.clientBuilder.setApiKey(ApiKeys.builder().setReader(apiKeyReader).build()); }
/** * Calls {@code clientBuilder.setApiKey(ApiKeys.builder().}{@link com.stormpath.sdk.api.ApiKeyBuilder#setSecretPropertyName(String) setSecretPropertyName(apiKeySecretPropertyName)}{@code .build())}. * * @param apiKeySecretPropertyName the name used to query for the API Key Secret from a Properties instance. * @see ClientBuilder#setApiKey(com.stormpath.sdk.api.ApiKey) * @see com.stormpath.sdk.api.ApiKeyBuilder#setSecretPropertyName(String) * @since 0.2 */ public void setApiKeySecretPropertyName(String apiKeySecretPropertyName) { this.clientBuilder.setApiKey(ApiKeys.builder().setSecretPropertyName(apiKeySecretPropertyName).build()); }
/** * Calls {@code clientBuilder.setApiKey(ApiKeys.builder().}{@link com.stormpath.sdk.api.ApiKeyBuilder#setInputStream(java.io.InputStream) setInputStream(apiKeyInputStream)}{@code .build())}. * * @param apiKeyInputStream the InputStream to use to construct a configuration Properties instance. * @see ClientBuilder#setApiKey(com.stormpath.sdk.api.ApiKey) * @see com.stormpath.sdk.api.ApiKeyBuilder#setInputStream(java.io.InputStream) * @since 0.2 */ public void setApiKeyInputStream(InputStream apiKeyInputStream) { this.clientBuilder.setApiKey(ApiKeys.builder().setInputStream(apiKeyInputStream).build()); }
/** * Calls {@code clientBuilder.setApiKey(ApiKeys.builder().}{@link com.stormpath.sdk.api.ApiKeyBuilder#setIdPropertyName(String) setIdPropertyName(apiKeyIdPropertyName)}{@code .build())}. * * @param apiKeyIdPropertyName the name used to query for the API Key ID from a Properties instance. * @see ClientBuilder#setApiKey(com.stormpath.sdk.api.ApiKey) * @see com.stormpath.sdk.api.ApiKeyBuilder#setIdPropertyName(String) * @since 0.2 */ public void setApiKeyIdPropertyName(String apiKeyIdPropertyName) { this.clientBuilder.setApiKey(ApiKeys.builder().setIdPropertyName(apiKeyIdPropertyName).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()); }
/** * 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()); }
@Autowired public void oktaOidcClientApiKey(@Qualifier("stormpathClientApiKey") ApiKey stormpathClientApiKey) { if (oktaEnabled) { Assert.hasText(oktaApplicationId, "When okta.enabled is true, okta.application.id " + "must be configured with your Okta Application ID. This can be found in the URL when accessing " + "you application in a browser."); Client client = stormpathClient(); String applicationCredentialsHref = "/api/v1/internal/apps/" + oktaApplicationId + "/settings/clientcreds"; ApplicationCredentials applicationCredentials = client.getResource(applicationCredentialsHref, ApplicationCredentials.class); ApiKey secondary = ApiKeys.builder() .setId(applicationCredentials.getClientId()) .setSecret(applicationCredentials.getClientSecret()) .build(); ((PairedApiKey)stormpathClientApiKey).setSecondaryApiKey(secondary); } }
@Bean public ApiKey stormpathClientApiKey() { ApiKeyBuilder builder = ApiKeys.builder(); String twoAppApiKeyId = System.getenv(twoAppApiKeyIdEnvName); String twoAppApiKeySecret = System.getenv(twoAppApiKeySecretEnvName); if (Strings.hasText(twoAppApiKeyId) && Strings.hasText(twoAppApiKeySecret)) { builder.setId(twoAppApiKeyId).setSecret(twoAppApiKeySecret); } else { log.warn( "Using TwoAppTenantStormpathConfiguration and " + "no " + twoAppApiKeyIdEnvName + " and/or " + twoAppApiKeySecretEnvName + " set" ); } return builder.build(); }