mbuczko / cerber-oauth2-provider

Clojure implementation of RFC 6749 OAuth 2.0 authorization framework (OAuth2 provider)
Apache License 2.0
58 stars 11 forks source link

It occurs "java.lang.Exception: Exception in :insert-token" error when I request token using MySQL database. #9

Closed jaredchendr closed 6 years ago

jaredchendr commented 6 years ago

It occurs java.lang.Exception: Exception in :insert-token.......Caused by: java.sql.BatchUpdateException: Incorrect string value: '\xAC\xED\x00\x05sr...' for column 'scope' at row 1 error when I request token using MySQL database.

Scope is a set, maybe a set can't be stored in MySQL database. I have a solution, I will make a pull request to you for this issue.

mbuczko commented 6 years ago

yup, confirmed. thanks for a fix!

mbuczko commented 6 years ago

having a bit of free time, I sorted out again the problem with scopes. I wanted to ensure that stores do not need to convert scopes to string and then back to set (on database read). instead, they should always work on plain string representation and the conversion should happen outside. otherwise each store (sql, redis or some custom defined) would need to deal with the same problem separately.

jaredchendr commented 6 years ago

Well done!