Git Product home page Git Product logo

Comments (7)

bilalbayasut avatar bilalbayasut commented on June 9, 2024

I've put the access-token in the headers and still it stays not authorized.

from angular-yii2.

githubjeka avatar githubjeka commented on June 9, 2024

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.

bilalbayasut avatar bilalbayasut commented on June 9, 2024

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.

githubjeka avatar githubjeka commented on June 9, 2024

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.

bilalbayasut avatar bilalbayasut commented on June 9, 2024

I see, so basically what you mean by access-token here is actually the auth_key? thanks in advance :)

from angular-yii2.

bilalbayasut avatar bilalbayasut commented on June 9, 2024

my url is
http://localhost/admbackend/rest/rest/web/v1/educationlevel/getall?access-token=vBZS7KGrvXesyOkgQhGYCY5KCZi6st5g

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.

githubjeka avatar githubjeka commented on June 9, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.