I’m creating an app to communicate with my iOS app, in the api controller I have this:
public function behaviors() {
return ArrayHelper::merge(parent::behaviors(), [
'authenticator' => [
'class' => QueryParamAuth::className(),
//'only' => ['subscrever', 'noticias', 'noticia', 'categorias'],
'only' => ['subscrever'],
],
'contentNegotiator' => [
'formats' => [
'application/json' => Response::FORMAT_JSON,
],
],
]);
}
Only action "subscrever" will really need to authenticate with the access-token provided, but I want to authenticate the user if he provides the an access-token.
At the the app only authenticate is the action is in only array, I want to try to authenticate every time the access-token is provided.
What is the best solution for this?