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

Commit 37a0cc4

Browse files
committed
First rough pass at converting Okta user resource map to/from Stormpath Account
Still a bunch of TODOs here, but initial code _should_ work for a POC
1 parent bdfb282 commit 37a0cc4

File tree

11 files changed

+415
-567
lines changed

11 files changed

+415
-567
lines changed

api/src/main/java/com/stormpath/sdk/okta/Profile.java

Lines changed: 0 additions & 115 deletions
This file was deleted.

api/src/main/java/com/stormpath/sdk/okta/User.java

Lines changed: 0 additions & 42 deletions
This file was deleted.

impl/src/main/java/com/stormpath/sdk/impl/account/DefaultAccount.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
import com.stormpath.sdk.impl.api.DefaultApiKeyOptions;
5050
import com.stormpath.sdk.impl.ds.InternalDataStore;
5151
import com.stormpath.sdk.impl.group.DefaultGroupMembership;
52+
import com.stormpath.sdk.impl.okta.OktaUserAccountConverter;
5253
import com.stormpath.sdk.impl.provider.IdentityProviderType;
5354
import com.stormpath.sdk.impl.resource.AbstractExtendableInstanceResource;
5455
import com.stormpath.sdk.impl.resource.CollectionReference;
@@ -141,7 +142,7 @@ public DefaultAccount(InternalDataStore dataStore) {
141142
}
142143

143144
public DefaultAccount(InternalDataStore dataStore, Map<String, Object> properties) {
144-
super(dataStore, properties);
145+
super(dataStore, new OktaUserAccountConverter().toAccount(properties));
145146
}
146147

147148
@Override

impl/src/main/java/com/stormpath/sdk/impl/application/LocalApplication.java

Lines changed: 113 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@
1616
import com.stormpath.sdk.application.ApplicationOptions;
1717
import com.stormpath.sdk.application.ApplicationStatus;
1818
import com.stormpath.sdk.application.webconfig.ApplicationWebConfig;
19+
import com.stormpath.sdk.application.webconfig.ApplicationWebConfigStatus;
20+
import com.stormpath.sdk.application.webconfig.ChangePasswordConfig;
21+
import com.stormpath.sdk.application.webconfig.ForgotPasswordConfig;
22+
import com.stormpath.sdk.application.webconfig.LoginConfig;
23+
import com.stormpath.sdk.application.webconfig.MeConfig;
24+
import com.stormpath.sdk.application.webconfig.Oauth2Config;
25+
import com.stormpath.sdk.application.webconfig.RegisterConfig;
26+
import com.stormpath.sdk.application.webconfig.VerifyEmailConfig;
1927
import com.stormpath.sdk.authc.AuthenticationRequest;
2028
import com.stormpath.sdk.authc.AuthenticationResult;
2129
import com.stormpath.sdk.directory.AccountStore;
@@ -28,6 +36,7 @@
2836
import com.stormpath.sdk.group.GroupList;
2937
import com.stormpath.sdk.idsite.IdSiteCallbackHandler;
3038
import com.stormpath.sdk.idsite.IdSiteUrlBuilder;
39+
import com.stormpath.sdk.impl.application.webconfig.DefaultApplicationWebConfig;
3140
import com.stormpath.sdk.impl.directory.OktaDirectory;
3241
import com.stormpath.sdk.impl.ds.InternalDataStore;
3342
import com.stormpath.sdk.impl.resource.AbstractCollectionResource;
@@ -337,7 +346,110 @@ public SamlPolicy getSamlPolicy() {
337346

338347
@Override
339348
public ApplicationWebConfig getWebConfig() {
340-
return null;
349+
// return null;
350+
351+
return new ApplicationWebConfig() {
352+
@Override
353+
public void save() {
354+
throw new UnsupportedOperationException("save() method hasn't been implemented.");
355+
}
356+
357+
@Override
358+
public String getHref() {
359+
throw new UnsupportedOperationException("getHref() method hasn't been implemented.");
360+
}
361+
362+
@Override
363+
public Date getCreatedAt() {
364+
throw new UnsupportedOperationException("getCreatedAt() method hasn't been implemented.");
365+
}
366+
367+
@Override
368+
public Date getModifiedAt() {
369+
throw new UnsupportedOperationException("getModifiedAt() method hasn't been implemented.");
370+
}
371+
372+
@Override
373+
public String getDomainName() {
374+
throw new UnsupportedOperationException("getDomainName() method hasn't been implemented.");
375+
}
376+
377+
@Override
378+
public String getDnsLabel() {
379+
throw new UnsupportedOperationException("getDnsLabel() method hasn't been implemented.");
380+
}
381+
382+
@Override
383+
public ApplicationWebConfig setDnsLabel(String dnsLabel) {
384+
throw new UnsupportedOperationException("setDnsLabel() method hasn't been implemented.");
385+
}
386+
387+
@Override
388+
public ApplicationWebConfigStatus getStatus() {
389+
throw new UnsupportedOperationException("getStatus() method hasn't been implemented.");
390+
}
391+
392+
@Override
393+
public ApplicationWebConfig setStatus(ApplicationWebConfigStatus status) {
394+
throw new UnsupportedOperationException("setStatus() method hasn't been implemented.");
395+
}
396+
397+
@Override
398+
public ApiKey getSigningApiKey() {
399+
throw new UnsupportedOperationException("getSigningApiKey() method hasn't been implemented.");
400+
}
401+
402+
@Override
403+
public ApplicationWebConfig setSigningApiKey(ApiKey apiKey) {
404+
throw new UnsupportedOperationException("setSigningApiKey() method hasn't been implemented.");
405+
}
406+
407+
@Override
408+
public Oauth2Config getOAuth2() {
409+
throw new UnsupportedOperationException("getOAuth2() method hasn't been implemented.");
410+
}
411+
412+
@Override
413+
public RegisterConfig getRegister() {
414+
throw new UnsupportedOperationException("getRegister() method hasn't been implemented.");
415+
}
416+
417+
@Override
418+
public LoginConfig getLogin() {
419+
throw new UnsupportedOperationException("getLogin() method hasn't been implemented.");
420+
}
421+
422+
@Override
423+
public VerifyEmailConfig getVerifyEmail() {
424+
throw new UnsupportedOperationException("getVerifyEmail() method hasn't been implemented.");
425+
}
426+
427+
@Override
428+
public ForgotPasswordConfig getForgotPassword() {
429+
throw new UnsupportedOperationException("getForgotPassword() method hasn't been implemented.");
430+
}
431+
432+
@Override
433+
public ChangePasswordConfig getChangePassword() {
434+
throw new UnsupportedOperationException("getChangePassword() method hasn't been implemented.");
435+
}
436+
437+
@Override
438+
public MeConfig getMe() {
439+
throw new UnsupportedOperationException("getMe() method hasn't been implemented.");
440+
}
441+
442+
@Override
443+
public Application getApplication() {
444+
throw new UnsupportedOperationException("getApplication() method hasn't been implemented.");
445+
}
446+
447+
@Override
448+
public Tenant getTenant() {
449+
throw new UnsupportedOperationException("getTenant() method hasn't been implemented.");
450+
}
451+
};
452+
341453
//throw new UnsupportedOperationException("getWebConfig() method hasn't been implemented.");
342454
}
343455

impl/src/main/java/com/stormpath/sdk/impl/directory/DefaultCustomData.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import com.stormpath.sdk.directory.CustomData;
1919
import com.stormpath.sdk.impl.ds.InternalDataStore;
20+
import com.stormpath.sdk.impl.okta.OktaUserAccountConverter;
2021
import com.stormpath.sdk.impl.resource.AbstractInstanceResource;
2122
import com.stormpath.sdk.impl.resource.DateProperty;
2223
import com.stormpath.sdk.impl.resource.Property;

0 commit comments

Comments
 (0)