Comments (7)
I've put the access-token in the headers and still it stays not authorized.
from angular-yii2.
You can get access-token via method https://github.com/githubjeka/yii2-rest/blob/master/rest/versions/v1/controllers/UserController.php#L18
And You can see to how it work in test
https://github.com/githubjeka/yii2-rest/blob/master/tests/codeception/rest/functional/PostAPICept.php
from angular-yii2.
How can I do the test using rest client application (etc postman)? what key and value should I put in the header or payload?
from angular-yii2.
Begin you should get this key from v1/user/login
. See comment githubjeka/yii2-rest#6 (comment)
You can see auth-key in bottom. After receiving the key, just add it to your url as '?access-token=tUu1qHcde0diwUol3xeI-18MuHkkprQI`
$I->sendPUT(
'/v1/posts/11111?access-token=tUu1qHcde0diwUol3xeI-18MuHkkprQI,
['title' => 'My first post', 'content' => 'There are many words....', 'status' => 2]
);
from angular-yii2.
I see, so basically what you mean by access-token here is actually the auth_key? thanks in advance :)
from angular-yii2.
I've tried and the result is :
{
name: "Not Supported"
message: ""findIdentityByAccessToken" is not implemented."
code: 0
type: "yii\base\NotSupportedException"
file: "C:\xampp\htdocs\admbackend\rest\common\models\User.php"
line: 123
from angular-yii2.
In advanced app findIdentityByAccessToken
is not implemented.
See my bad implement
For understanding:
Auth-key use for cookie of remember me
in Yii. Better to create new field access-token
in table User
singly. And work with him in findIdentityByAccessToken instead auth_key
from angular-yii2.
Related Issues (12)
- problem: User is Guest HOT 14
- How to pass username and password in url HOT 10
- https://yii2-rest-githubjeka.c9.io/rest/web/ down? HOT 2
- Redirect to http://localhost/404 HOT 2
- How can access this application on localhost HOT 1
- it should be 'php init' instead of 'php yii init' HOT 1
- Demo server down HOT 1
- How can I test the login api?
- After successful login ,click Post (Published) or Post (Draft) ,display Object not found! 404 error HOT 1
- After Post (Published) or Post (Draft) ,display Object not found! 404 error HOT 2
- Your zip file is empty HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-yii2.