I have 2 internal Rails services, which need to speak to each other. I need an advice how to make it secure enough and with minimum effort.
Currently service A sends Authorization
HTTP header to service B, which contains secret token. Simple HTTP Token-based method, nothing special. But I also need somehow to communicate a user token, so service B will know, which user is talking to it.
My current solution is following:
- send
Authorization Token token=blabla user_token=blabla2
- use existing in Rails methods to parse it
- identify user by provided
user_token
- inspired by this StackOverflow post
Alternatives:
- Amazon way with something like: Authorization: MY-APP-V1 Token=blabla Credential=user_token, but I need custom parser for it.
- Custom HTTP header like
X-USER-TOKEN
, but seems like RFC is not in favor of this idea. - Your proposal or suggestion
Thank you very much for any help.