Secure REST Service

HI,

I’m currently writing a REST Service for an iOS App and now I would like to secure it…

I’ going to do the following:

Each Request should send an API public key and also a check string that is generated using a API private key and all parameters. These two values are send as header values…

So far so good…

But what is the best way to handle the check in my Controller? Should I do this in every action or is there a more generic way to handle this?

Thanks for your Help,

Urkman

You need to implement IdentityInterface within your User model

http://www.yiiframework.com/doc-2.0/guide-security-authentication.html

And then you need to follow this:

http://www.yiiframework.com/doc-2.0/guide-rest-authentication.html