Skip to content

problem with SQL SERVER MICROSOFT #1087

@matteonisimone

Description

@matteonisimone

I encountered a problem with SQL SERVER
when inserting the access token and refresh token into oauth_access_tokens and oauth_refresh_tokens in src\OAuth2\Storage\Pdo.php
line 409 for setRefreshToken
line 206 for setAccessToken
returns this error
SQLSTATE[22007]: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]The conversion of an nvarchar data type to datetime generated a value outside the allowed range
the field causing the error is the datetime --> expires

To resolve this issue at this time,
can I set the changes to VARCHAR and not DATETIME
or do I need to modify the line
$expires = date('Y-m-d H:i:s', $expires);
in
$expires = date('Y-d-m H:i:s', $expires);

To ensure correct insertion, you could consider passing the function with {ts 'YYYY-MM-DD HH:MM:SS'}

do you have a better solution to propose?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions