i am working on a spring rest project and using OAuth 2.0 to protect these API's from unauthorised access.
Frontend: Angular.js Backend: Spring Rest+ Spring Security + Oauth2
Everything was working fine:
1) I got a token from backend using oauth with following uri:
..../oauth/token?grant_type=password&client_id=angularapp&client_secret=angularapp&[email protected]&password=user5@123
2) I got a token from backend and use that token to acess the API's.
Now my problem is that, once i hit backend with /oauth/token?grant_type=password&client_id=angularapp&client_secret=angularapp&[email protected]&password=user5@123
this uri, this is all there at page in angular js files, anyone can access them with view page source.
Please suggest a way to hide these credential at js level, some encryption or any other implement at backend if necessary.
Do i implementing it wrong? please suggest a right path
Thanks