Skip to content
This repository has been archived by the owner on Dec 10, 2018. It is now read-only.

Can't work with Laravel Passport #61

Closed
yaquawa opened this issue Aug 29, 2018 · 3 comments
Closed

Can't work with Laravel Passport #61

yaquawa opened this issue Aug 29, 2018 · 3 comments

Comments

@yaquawa
Copy link

yaquawa commented Aug 29, 2018

Laravel Passport will throw errors if using binary UUID.
I just created a package laravel-passport-binary-uuid-adapter to allow Passport accept binary UUID to work with this package.

I found some people encountering the same issue here, so if you don't mind, add a link to this package to your README will be helpful for people who are using Passport I think😃

@afraca
Copy link

afraca commented Sep 7, 2018

This is quite interesting. I did some initial tweaking with this. I changed the (passport) migrations (published them) to use binary UUIDs everywhere. I extended all Passport models with my own. You can use

Passport::useAuthCodeModel(AuthCode::class);
        Passport::useClientModel(Client::class);
        Passport::usePersonalAccessClientModel(PersonalAccessClient::class);
 Passport::useTokenModel(Token::class);

I applied the README parts about model modifications to the custom Passport models.

I saw a working php artisan passport:client --personal with it, but have no idea what other things are breaking at the moment. Will continue later on (hopefully).

@yaquawa
Copy link
Author

yaquawa commented Sep 7, 2018

Hi @afraca

I extended all Passport models with my own

I did the same, you can have a look at the source code.

But unfortunately, this is not enough, for example, for some cases Passport want to convert a token into a response, which requires using the json_encode function, this will throw an error because it can't encode the binary string correctly using the UTF-8 encoding schema.

The package I published has been tested for all the grant types, currently works fine for me.

@freekmurze
Copy link
Member

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants