Closed anilkumar-isol closed 6 years ago
Hi @anilkumar-isol
For your code, you should use the ClientBuilder instead of creating a new instance of Client directly.
$client = (new \Okta\ClientBuilder())
->setToken('YourApiToken')
->setOrganizationUrl('https://dev-123456.oktapreview.com')
->build();
Once you are looking to get a user, the code below should work for you.
$user = new \Okta\Users\User();
$foundUser = $user->get('00u5zrthay2733Fir0h7'); //replace this id with the i
var_dump($foundUser);
Hi there,
I have already used okta api with my own custom code but I'm using this sdk just to get custom attributes.
Question1: As we know that okta api doesn't return custom attributes for users until we update that object with post method. Also I read a discussion thread(https://support.okta.com/help/answers?id=906F0000000HzygIAC) says that Java-sdk return custom attributes with some (unmapped()) function so my question is, Is this sdk will return custom attributes without any extra efforts?
Question2: I have installed this sdk but when I tried to get a user, it always gives me a blank response. What should I have to do in this situation?
This is my code.
Please help me out.
Thanks in advance