User authentication API gives 302 error code from Rest Template in SpringBoot, but postman shows 200 for same request, Any hint?

I am getting 200,ok from postman for URL- http://dev-84743839.okta.com/api/v1/users/xxx but getting 302 from spring boot rest template. maybe url is overriden from restTemplate. Not sure. Can anybody help me? Fixed with https instead http