Comments (4)
From a brief test that looks like exactly what we are looking for! Thanks for getting on this so quickly.
from okta-sdk-java.
Thanks for posting @literallyjustroy!
Will get this addressed, we welcome PRs also, feel free to submit a PR if you could.
from okta-sdk-java.
So the real problem is that the PolicyApi getPolicy
method returns a Policy
, which doesn't have a settings field. Since it doesn't even hold the arbitrary data, it can't be cast to a PasswordPolicy
. It appears my only option is to call the api directly:
PasswordPolicy passwordPolicy = oktaPolicyApi.getApiClient()
.invokeAPI("/api/v1/policies/{policyId}",
HttpMethod.GET,
Collections.singletonMap("policyId", passwordPolicyId),
null,
null,
new HttpHeaders(),
new LinkedMultiValueMap<>(),
null,
Collections.singletonList(MediaType.APPLICATION_JSON),
MediaType.APPLICATION_JSON,
new String[]{"apiToken", "oauth2"},
new ParameterizedTypeReference<PasswordPolicy>() {}
).getBody();
It seems like this usage is flawed, there is no way to get anything other then the general Policy info from the SDK (other than calling endpoints directly). It seems like the getPolicy
method shouldn't return a Policy
but an object that extends Policy
.
On a somewhat similar note, I am not seeing a way to create a new IDP_DISCOVERY Policy Rule. There is no IdentityProviderPolicyRule
class. The AccessPolicyRule
class seems to include most of the same fields so I can use that perhaps, but when I need to specify the IdpPolicyRuleActionProvider
there is no way to set the ID, so I get stuck. I'm not sure if I'm missing something glaring or if this just cannot be done with the version 10 Okta SDK.
If you believe any of this is relatively easy to add I do not mind to spend a few days looking into it.
from okta-sdk-java.
@literallyjustroy 11.0.0 just got released.
With this latest release, you should be able to use PolicyApiHelper
to get sub-typed Policy
objects.
PolicyApiHelper<Policy> policyApiHelper = new PolicyApiHelper<>(new PolicyApi(getClient()));
PasswordPolicy passwordPolicy = (PasswordPolicy) policyApiHelper.getPolicy(policy.getId(), null);
Similarly, PolicyRule
sub-classes can be created using the PolicyApiHelper
instance:
Let me know if that helps!
from okta-sdk-java.
Related Issues (20)
- ClassNotFoundException with current dependencies in Gradle build HOT 4
- Okta Verify Fast Pass as an enrolled Factor is not returned HOT 8
- UserProfile equals() does not return true when objects are equal HOT 1
- Upgrade to 13.0.2 causes updateUser API to fail from attribute being mastered by a different system HOT 8
- `IdentityProviderApi` cannot properly deserialize `/ipds` responses HOT 1
- Create authorization server policy with type OAUTH_AUTHORIZATION_POLICY get error HOT 3
- IdP Discovery Policy not returned in listPolicyRules() HOT 2
- GroupsAPI - Custom group profile attributes missing HOT 3
- Several outdated dependencies
- OpenAPI spec missing some default role type HOT 3
- Invalid session HOT 3
- IdpPolicyRuleActionProvider needs the ability to set the provider id to be useful for creating IDP Routing Rules HOT 3
- Private Key is interpreted as PEMKeyPair instead of PrivateKeyInfo HOT 3
- Consistently thrown NoHttpResponseException's in 13.0.3 HOT 3
- UserApi#listUserGroups() doesn't support pagination HOT 4
- UserApi: listUserGroups() does not return more than 200 groups for a user HOT 1
- Question about thread safety of `PaginationUtil` HOT 2
- Support Apple as an IdentityProviderType HOT 3
- Update Application User returns E0000009 with no message HOT 1
- Jar for package in Maven corrupted
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from okta-sdk-java.