Skip to content

Error: Data too long for column 'access_token' #103

Description

@zblesk

I'm trying to make OIDC login work with Authentik.
This is still my config:

    environment:
      HTTP_SERVER_PORT: 80
      HTTP_SERVER_CORS: "*"
      DATABASE_DRIVER: mysql
      DATABASE_NAME: pastefy
      DATABASE_USER: pastefyusr
      DATABASE_PASSWORD: passwd
      DATABASE_HOST: mariadb
      DATABASE_PORT: 3306
      SERVER_NAME: "https://domain"
      OAUTH2_CUSTOM_CLIENT_ID: id
      OAUTH2_CUSTOM_CLIENT_SECRET: passwd
      OAUTH2_CUSTOM_AUTH_ENDPOINT: https://domain/application/o/authorize/
      OAUTH2_CUSTOM_TOKEN_ENDPOINT: https://domain/application/o/token/
      OAUTH2_CUSTOM_USERINFO_ENDPOINT: https://domain/application/o/userinfo/

You've already helped me get over the first problem.

The next one was an error saying I don't have the right redirect_uri. With some reading here and some guesswork, the error stopped showing up after I set a strict redirect url to: https://domain/api/v2/auth/oauth2/oidc/callback.

Now most of the flow looks correct: I get redirected to Authentik, confirm, get redirected back and get this error:

{
  "success": false,
  "exception": "InvocationTargetException",
  "error": true,
  "exists": false
}

The URL I see this on is https://domain/api/v2/auth/oauth2/oidc/callback?code=bdc7d862fb374c2d85a350b7e04cbe7d&state=

when I check out logs in docker-compose, I see this:

pastefy  | Caused by: org.javawebstack.orm.exception.ORMQueryException: Data truncation: Data too long for column 'access_token' at row 1
pastefy  |      at org.javawebstack.orm.Repo.executeCreate(Repo.java:131)
pastefy  |      at org.javawebstack.orm.Repo.create(Repo.java:93)
pastefy  |      at org.javawebstack.orm.Repo.save(Repo.java:86)
pastefy  |      ... 17 more
pastefy  | java.lang.reflect.InvocationTargetException
pastefy  |      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
pastefy  |      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
pastefy  |      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
pastefy  |      at java.base/java.lang.reflect.Method.invoke(Method.java:569)
pastefy  |      at org.javawebstack.orm.Model.save(Model.java:130)
pastefy  |      at de.interaapps.pastefy.auth.OAuth2Callback.handle(OAuth2Callback.java:44)
pastefy  |      at de.interaapps.pastefy.auth.strategies.oauth2.OAuth2Strategy.lambda$createRoutes$1(OAuth2Strategy.java:36)
pastefy  |      at org.javawebstack.http.router.HTTPRouter.execute(HTTPRouter.java:399)
pastefy  |      at org.javawebstack.http.router.HTTPRouter.lambda$start$2(HTTPRouter.java:337)
pastefy  |      at org.javawebstack.http.router.undertow.UndertowHTTPSocketServer.lambda$start$1(UndertowHTTPSocketServer.java:50)
pastefy  |      at io.undertow.server.Connectors.executeRootHandler(Connectors.java:395)
pastefy  |      at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:859)
pastefy  |      at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
pastefy  |      at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
pastefy  |      at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
pastefy  |      at org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1282)
pastefy  |      at java.base/java.lang.Thread.run(Thread.java:840)

I'm not sure if this is a bug, or a config error on my part.
Thanks for any help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions