
User16699705382923123448 (Customer) asked a question.
I am using a Okta API for creating a user and for login. And API's are working fine on Postman and also working on localhost. But when its deployed on a server. Login api is not working, every time it is throwing Unauthorized. I already added my application url to trusted origins. Anything I am missing?

Hello @User16699705382923123448 (Customer) Thank you for reacting out to our Community!
Please make sure that the ports/IP's are not blocked for the application, which could cause the API call to be blocked.
Please also review our Cors doc and make sure that everything is set accordingly:
https://help.okta.com/en-us/Content/Topics/Security/API-trusted-origins.htm
Community members help others by clicking Like or Select as Best on responses. Try it today.
Hi Kiran. Could you post your login API call here ( minus anything sensitive ). There is nothing fundamentally different between Postman/localhost/server unless you've mangled the API endpoints or the authentication elements of the API call in changing between environment. If it works in one it should work in all of them.
Presume you're using Primary Authentication with trusted Application, so the call itself is simple enough. As long as the API key you're using is correct for the environment you're targeting, it should just work.