I have the following problem:
- There are 3 parties A, B and X.
- X is holding 2 entities on behalf of A and B.
- A communicates with X to operate it's own entity. B also communicates with X to operate it's own entity.
- Permissions could be revoked at any time for A and B to access their entities.
- Permission revocation is done by Y.
I want to do all this in a secure way.
First, I will try to boil it down to some requirements. Does this look correct?
- I need a secure channel between A <-> X and B <-> X so that no MITM can happen
- X needs to be able to authenticate who the caller is. Is it A or B who is trying to access the entity.
- X needs to be able to authorize the operation on the entity. That is, is the operation still permitted or revoked?
- A (likewise B) contacts Y with it's ID and the permissions it is requesting ( -- OAuth style or something else ... not sure how this works)
- Y approves (or rejects) the permission. If approved, it returns back a token ( -- this token is encrypted and can only be decrypted by X. It is signed by Y and X can verify that Y has signed this token. The token contains a unique id as well a a note saying "I verify that the token holder is actually A")
- A establishes a TLS channel with X.
- A provides the token to X.
- X verifies the signature of the token. If successful, A is permitted to perform the operation on it's corresponding entity.
- Does this look correct? Any flaws?
- What will I do if I cannot use a CA to establish a TLS channel?