DEV Community

Discussion on: Secure your PHP REST API with Magic

Collapse
 
0yorick0 profile image
Yorick

Thank you for this great tutorial.

I have one question though. It's about the DID token that you use with Postman to test your API. I've spend a lot of time reading the Magic doc and exploring the dashboard, but it seems to me that at this time there's no way to get a fake DID token from the dashboard (I mean, like I was a simple user).

The only way seems to build a client-side app and use it to test our API. Am I wright ?

If this is the case, you may want to mention it in your tutorial, to avoid us to look for something that doesn't exists^^

And if I'm wrong, could you please show me where to find on the dashboard this fake DID token, so that I can test the API ?

Thank you in advance :)

Collapse
 
shahbaz17 profile image
Mohammad Shahbaz Alam

Hello Yorick,

Thanks for asking this question.

As of now, there is no fake DID token. One has to build a frontend application to get a DID token to test.

For now, run:
php -S localhost:8002 -t public

If you are following github.com/shahbaz17/magic-php-res...

This will start frontend application, where you will get the DID token.

Thank you for mentioning, I will add this line to the post.

Collapse
 
shahbaz17 profile image
Mohammad Shahbaz Alam

Or get a DID token from b8e51.csb.app/ for testing.