title: Yii 2.0 authentication in UserIdentity without database
body: <p>Any idea about authentication without using database?.
  I have gone through the basic template. In that app/models/User.php ,they have provided validations based on </p>
  
  <pre><code> private static $users = [
          '100' =&gt; [
              'id' =&gt; '100',
              'username' =&gt; 'admin',
              'password' =&gt; 'admin',
              'authKey' =&gt; 'test100key',
              'accessToken' =&gt; '100-token',
          ],
          '101' =&gt; [
              'id' =&gt; '101',
              'username' =&gt; 'demo',
              'password' =&gt; 'demo',
              'authKey' =&gt; 'test101key',
              'accessToken' =&gt; '101-token',
          ],
      ];
  </code></pre>
  
  <p>But I want the login validation based on a different condition , for example if a variable satisfies some conditions , the he should be logged on. Or any idea on whether I can set <code>Identity</code> Manually?</p>
  
  <p>I referred to <a href="http://www.yiiframework.com/doc-2.0/yii-web-identityinterface.html" rel="noreferrer">http://www.yiiframework.com/doc-2.0/yii-web-identityinterface.html</a> , it also mentions about only using database. Is it necessary to set <code>'authKey'</code> and  <code>'accessToken'</code> ?</p>
  
  <p>Or anyone can explain the flow of authentication in Yii 2.0 , which values to be set , in which order ?</p>