hi everyone,
i’m using mezzio for api and chose OAuth2 for authentication
when send user info to TokenEndpointHandler for request token,
( grant_type = password)
reterun this error:
{
“error”: “access_token_duplicate”,
“error_description”: “Could not create unique access token identifier”,
“message”: “Could not create unique access token identifier”
}
i found this error: ./vendor/mezzio/mezzio-authentication-oauth2/src/Repository/Pdo/AccessTokenRepository.php
Method persistNewAccessToken() sets values to table oauth_access_tokens, fields user_id and client_id set values as strings, but columns type is integer
I will try to investigate this next week. The information in the issue seems quite sparse to me. Any ideas where to start? Seems like a very basic problem that has been around for some time.
So here is what i think: it is just wrong column types in the sql-scripts. It should be a string and it works when you use other column types.
To be clear:
client_id and user_id in auth_codes table are INT but they are represented as strings in the according interfaces in code (ClientEntityInterface, UserEntityInterface) and also used as such strings in all requests to the server (client_id=“client_test”, …)
Anybody help me out basic oauth2 example code for authentication. Entity and repository i have but struggle to implement and do the authentication.
using doctrine ORM