Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to Convert an Okta User to the Federated Provider Type using Java SDK #5016

Open
oksanaspecter opened this issue Aug 15, 2024 · 4 comments

Comments

@oksanaspecter
Copy link

Thank you for getting involved with Okta's Developer Docs!

Note: If you are an Okta employee, please clone this Jira instead of opening a GitHub issue.

Please provide the following information so that we can act on your feedback.

Affected page(s):
https://developer.okta.com/docs/reference/api/users/#request-example-convert-a-user-to-a-federated-user
https://developer.okta.com/docs/reference/api/users/#provider-object
https://support.okta.com/help/s/article/How-to-convert-Okta-user-to-Federated-provider-type?language=en_US#:~:text=To%20convert%20a%20user%20to,the%20FEDERATION%20as%20provider%20parameter.

Describe the problem(s):
Able to convert Okta user into Federated user through Postman by setting a query parameter provider to FEDERATION. However, not able to do it programmatically as resetPasswod(Boolean sendEmail) in SDK doesnt accept provider parameter. How can we do it using java sdk? I did see in your migration documentation that resetPassword(Provider provider, Boolean sendEmail) has been deprecated. Whats an alternative solution to convert Okta user into a Federated user?

If possible, describe a proposed fix:

We will do our best to respond to you within 2 working days.

@brianduffield-okta
Copy link
Contributor

@oksanaspecter Thanks for the feedback. I'll work with our engineering and SDK teams to get an update for you.

@oksanaspecter
Copy link
Author

oksanaspecter commented Aug 15, 2024

Thank you. I ended up calling Okta API directly as the work around

 String url = "/api/v1/users/" + oktaId + "/lifecycle/reset_password";
    Map<String,String> queryParameters = new HashMap<>();
    queryParameters.put("sendEmail", "false");
    queryParameters.put("provider", "FEDERATION");
    oktaClient.http().setQueryParameters(queryParameters).post(url, VoidResource.class);

But still would like to know how can i leverage SDK library going forward.

@arvindkrishnakumar-okta
Copy link
Contributor

arvindkrishnakumar-okta commented Aug 15, 2024

@oksanaspecter Currently, the Java SDK does NOT have a direct way to supply this query parameter provider for the resetPassword(...) a.k.a. generateResetPasswordToken(...) API because the public documentation (and OpenAPI spec) based on which the SDK is generated does not list this (https://developer.okta.com/docs/reference/api/users/#request-parameters-16).

We will work this out with the team that owns this API and update you.

Glad to know you found a workaround until then.

@arvindkrishnakumar-okta
Copy link
Contributor

arvindkrishnakumar-okta commented Aug 16, 2024

Created internal ticket - OKTA-794001 for reference.

cc: @brianduffield-okta

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants