thephpleague / oauth2-server

A spec compliant, secure by default PHP OAuth 2.0 Server

Home Page:https://oauth2.thephpleague.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Best way to validate account by email

shinnokdisengir opened this issue · comments

Hi,
I want to validate a subscribed account by email, send him a link like

http://server/validate/{{jwtToken}}
using query strings could be fine too
http://server/validate/?token={{token}}&client_id={{blabla}}

I understood how to issue a new token, but I'm not sure is the best way, I think I'd better to create a new Grant/AuthorizationValidator.

$accessToken = new AccessTokenEntity();
$accessToken->setClient($this->clientRepository->getClientEntity('test'));
$accessToken->setIdentifier('dottore');
$accessToken->setUserIdentifier($account->username);
$accessToken->setExpiryDateTime(new DateTimeImmutable('+1 hour'));
$accessToken->setPrivateKey(new CryptKey('file://' . __DIR__ . '/../../../private.key'));

Are there some examples? Can you help me?
Thanks

Sorry I think this is a more general OAuth question and is probably better suited to something like Stack Overflow. Apologies I can't be of help in this instance