{"repo":"yiisoft/auth","free":true,"listed":false,"github":"https://github.com/yiisoft/auth","clone":"git clone https://github.com/yiisoft/auth.git","description":null,"language":"PHP","stars":39,"topics":["auth","authentication","middleware","yii3","psr-15","basic","bearer","hacktoberfest"],"license":"BSD-3-Clause","category":"auth-billing-email","readme_excerpt":"Yii Auth The package provides various authentication methods, a set of abstractions to implement in your application, and a PSR-15 middleware to authenticate an identity. Requirements - PHP 8.1 - 8.5. Installation General usage Configure a middleware and add it to your middleware stack: In order to get an identity instance in the following middleware use getAttribute() method of the request instance: HTTP basic authentication Basic HTTP authentication is typically used for entering login and password in the browser. Credentials are passed as $ SERVER['PHP AUTH USER'] and $ SERVER['PHP AUTH PW'] . Realm is typically what you will see in the browser prompt asking for a login and a password. Custom authentication callback set in the above is the same as default behavior when it is not specified. HTTP bearer authentication Bearer HTTP authentication is typically used in APIs. The authentication token is passed in the request's Authorization header. On failure, the failure handler adds a WWW-Authenticate response header. Custom HTTP header authentication Custom HTTP header could be used if you do not want to leverage bearer token authentication: In the above we use full value of X-Api-Key header as token. Query parameter authentication This authentication method is mainly used by clients unable to send headers. In case you do not have such clients we advise not to use it. HTTP cookie authentication Typical authentication for websites by storing a token in a browser cookie. Using m","default_branch":null,"files":null,"tree":[],"storefront":"/r/yiisoft","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/yiisoft/auth/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}