10-06-2022 01:34 AM
Using Postman I am unable to authenticate to the EIC REST API. I always get back "Invalid username or password". I have tested with both the admin user and a new user I created which I:
I have enabled OAuth under Under Admin -> Settings -> OAuth Settings.
I'm POSTing to: {{base_url}}/ECMv6/api/auth/login
With a body of:
If I log into EIC as either user I can generate a token and use to authenticate in other requests, and this works fine. It is just the getting the initial token via username and password which doesn't work. (I need this to work as apps are going to be connecting automatically and won't be able to log into EIC to manually get a token.)
Any ideas what other config I have missed or could have got wrong?
Solved! Go to Solution.
10-06-2022 04:58 AM
10-06-2022 07:21 AM - edited 10-06-2022 07:24 AM
Yes I can login to the browser with the user (I did this to get the web token)
Yes it has the ROLE_ADMIN Sav role which has every 'Web Service Access' selected
In the logs I can't see anything happening around this time apart from:
2022-10-06T14:19:12.324868001Z stdout F 212.229.164.165 - - [06/Oct/2022:14:19:12 +0000] POST /ECMv6/api/auth/login HTTP/1.1" 401 28 "-" "PostmanRuntime/7.29.2" 415 5.084 [default-gateway-8765] [] 192.86.0.16:8765 28 5.084 401 4e6ec7093f65e20b0064a7f2bc4ed8e1"
2022-10-06T14:19:12.249169901Z stdout F 2022-10-06 14:19:12.249 INFO [traceId=bb47d1e706e5fc4e, spanId=bb47d1e706e5fc4e, spanExportable=true, X-Span-Export=true, X-B3-SpanId=bb47d1e706e5fc4e, TENANT_ID=DEFAULT, X-B3-TraceId=bb47d1e706e5fc4e] 7 --- [http-nio-8480-exec-4] c.s.s.userms.service.UserDetailsService : Inside userAccessValidate method..
10-06-2022 07:39 AM
I got it working now. It looks like an error in the documentation: Saviynt Security Manager API Reference v2021.0/Summer Release (getpostman.com)
The URL should be "/ECM/api/login" but it has "/ECMv6/api/auth/login"
I found it was wrong by downloading the Postman collection and it had the correct URL: Saviynt Security Manager API Reference v2021.0/Summer Release | Saviynt -Valmet | Postman API Networ...
10-06-2022 08:02 AM
Thanks for the feedback @MarkHancock, We will pass it on to the documentation team to have it validated and corrected.
10-06-2022 07:39 AM
{{url}}/ECM/api/login Try this url & hardcode value in username & password instead of global varaibles