gauth-jpa

74 views
Skip to first unread message

Paul Mitchell

unread,
Nov 18, 2016, 5:50:10 AM11/18/16
to CAS Community
Hi,

I found what appears to be a bug in GoogleAuthenticatorRegistrationRecord.java the record contains the lines

 @Column(length = Integer.MAX_VALUE, updatable = true, insertable = true, nullable = false)

for two of the string fields in the class.  This causes Hibernate to generate the follow SQL:

  create table GoogleAuthenticatorRegistrationRecord (id bigint not null, secretKey varchar(2147483647) not null, username varchar(2147483647) not null, validationCode integer not null, primary key (id))

which naturally MySQL complains about the size of the varchar.  This was changed between RC4 and 5.0.0 with commit 'fe1155a'. Prior to the commit the length was 255.  There is also an integer field validationCode which also had a length of 255, which was changed to Integer.MAX_VALUE which to me make sense.

Can submit an issue/pull request with what I think it should be but wanted to check in if there was a good reason for this that I am not aware of.  

Regards,
Paul.

Misagh Moayyed

unread,
Nov 18, 2016, 9:49:03 AM11/18/16
to cas-...@apereo.org

Is the MySQL complaint causing issues?

 

--Misagh

--
- CAS gitter chatroom: https://gitter.im/apereo/cas
- CAS mailing list guidelines: https://apereo.github.io/cas/Mailing-Lists.html
- CAS documentation website: https://apereo.github.io/cas
- CAS project website: https://github.com/apereo/cas
---
You received this message because you are subscribed to the Google Groups "CAS Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/f938e37b-4d90-4b05-bce1-5b317523bef8%40apereo.org.

Paul Mitchell

unread,
Nov 18, 2016, 10:32:02 AM11/18/16
to cas-...@apereo.org
Also this is on MySQL 5.7.16

On 18 November 2016 at 14:52, Paul Mitchell <pauldmi...@gmail.com> wrote:
Yes, the table is not created an MySQL returns an error of:

ERROR 1074 (42000): Column length too big for column 'secretKey' (max = 65535); use BLOB or TEXT instead

Regards,
Paul.

Paul Mitchell

unread,
Nov 18, 2016, 10:32:02 AM11/18/16
to cas-...@apereo.org
Yes, the table is not created an MySQL returns an error of:

ERROR 1074 (42000): Column length too big for column 'secretKey' (max = 65535); use BLOB or TEXT instead

Regards,
Paul.
On 18 November 2016 at 14:48, Misagh Moayyed <mmoa...@unicon.net> wrote:

To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+unsubscribe@apereo.org.

--
- CAS gitter chatroom: https://gitter.im/apereo/cas
- CAS mailing list guidelines: https://apereo.github.io/cas/Mailing-Lists.html
- CAS documentation website: https://apereo.github.io/cas
- CAS project website: https://github.com/apereo/cas
---
You received this message because you are subscribed to the Google Groups "CAS Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+unsubscribe@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/00aa01d241aa%24e1b42110%24a51c6330%24%40unicon.net.

Misagh Moayyed

unread,
Nov 18, 2016, 10:38:32 AM11/18/16
to cas-...@apereo.org

Great. As an alternative, can you experiment with column definitions or @Type annotations to enforce a better type such as text?

 

I suppose the thing I dislike is that 255 (and similar numbers) is such an arbitrary value. If you can find a reasonable number that would work for most databases and not just MYSQL and the size can account for reasonable secret key lengths, then sure. File an PR please.

Paul Mitchell

unread,
Nov 18, 2016, 11:14:46 AM11/18/16
to cas-...@apereo.org
My thoughts on that was since GoogleAuth uses Base32 of an 80 bit key so that is 16 bytes. So a 8192 bit key at base32 should be around 1639. 

Regards,
Paul.

To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+unsubscribe@apereo.org.

--
- CAS gitter chatroom: https://gitter.im/apereo/cas
- CAS mailing list guidelines: https://apereo.github.io/cas/Mailing-Lists.html
- CAS documentation website: https://apereo.github.io/cas
- CAS project website: https://github.com/apereo/cas
---
You received this message because you are subscribed to the Google Groups "CAS Community" group.

To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+unsubscribe@apereo.org.

--
- CAS gitter chatroom: https://gitter.im/apereo/cas
- CAS mailing list guidelines: https://apereo.github.io/cas/Mailing-Lists.html
- CAS documentation website: https://apereo.github.io/cas
- CAS project website: https://github.com/apereo/cas
---
You received this message because you are subscribed to the Google Groups "CAS Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+unsubscribe@apereo.org.

--
- CAS gitter chatroom: https://gitter.im/apereo/cas
- CAS mailing list guidelines: https://apereo.github.io/cas/Mailing-Lists.html
- CAS documentation website: https://apereo.github.io/cas
- CAS project website: https://github.com/apereo/cas
---
You received this message because you are subscribed to the Google Groups "CAS Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+unsubscribe@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/014a01d241b1%24cc1c4fb0%246454ef10%24%40unicon.net.

Reply all
Reply to author
Forward
0 new messages