Skip to content
This repository was archived by the owner on Dec 12, 2018. It is now read-only.

Commit 4a8285c

Browse files
committed
1309: checkpoint
1 parent a95a812 commit 4a8285c

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

extensions/spring/stormpath-spring/src/main/java/com/stormpath/spring/config/AbstractStormpathConfiguration.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import com.stormpath.sdk.client.Client;
2525
import com.stormpath.sdk.client.ClientBuilder;
2626
import com.stormpath.sdk.client.Clients;
27+
import com.stormpath.sdk.client.DefaultPairedApiKey;
2728
import com.stormpath.sdk.client.Proxy;
2829
import com.stormpath.sdk.lang.Assert;
2930
import com.stormpath.sdk.lang.Strings;
@@ -100,6 +101,9 @@ public abstract class AbstractStormpathConfiguration {
100101
@Value("#{ @environment['okta.api.token'] }")
101102
protected String oktaApiToken;
102103

104+
@Value("#{ @environment['okta.application.id'] }")
105+
protected String oktaApplicationId;
106+
103107
public ApiKey stormpathClientApiKey() {
104108

105109
if (oktaEnabled) {
@@ -207,10 +211,16 @@ protected Proxy resolveProxy() {
207211
return proxy;
208212
}
209213

214+
public ApiKey oktaOidcClientApiKey() {
215+
//Brian:
216+
return ApiKeys.builder().setId("foo").setSecret("bar").build();
217+
}
218+
210219
public Client stormpathClient() {
211220

221+
ApiKey apiKey = stormpathClientApiKey();
222+
212223
ClientBuilder builder = Clients.builder()
213-
.setApiKey(stormpathClientApiKey())
214224
.setCacheManager(stormpathCacheManager());
215225

216226
if (oktaEnabled) {
@@ -231,6 +241,11 @@ public Client stormpathClient() {
231241
if (append != null) {
232242
baseUrl += append;
233243
}
244+
245+
apiKey = new DefaultPairedApiKey(apiKey, oktaOidcClientApiKey());
246+
247+
} else {
248+
builder.setApiKey(stormpathClientApiKey());
234249
}
235250

236251
if (authenticationScheme != null) {

0 commit comments

Comments
 (0)