Getting "Security issue: Signature length not correct: got 256 but was expecting 128" since about one hour ago.

8,827 views
Skip to first unread message

Erik Zivkovic

unread,
Jun 11, 2015, 8:34:30 AM6/11/15
to google-a...@googlegroups.com
I am using code from http://android-developers.blogspot.se/2013/01/verifying-back-end-calls-from-android.html and have been using it for a long time to authenticate users for my service, but since about one hour ago I am getting "Security issue: Signature length not correct: got 256 but was expecting 128", it is being thrown from GoogleIdTokenVerifier.verify


Someone else experiencing the same issue?

BR Erik
Message has been deleted

Tom Edge

unread,
Jun 11, 2015, 9:47:54 AM6/11/15
to google-a...@googlegroups.com

Nhat Nguyen

unread,
Jun 11, 2015, 9:53:40 AM6/11/15
to google-a...@googlegroups.com
I am experiencing the same issue now. I have to temporary disable authentication.

Roel de Brouwer (werk)

unread,
Jun 11, 2015, 11:25:09 AM6/11/15
to google-a...@googlegroups.com
What the actual heck? But why are so few people that suffer from this? I can only found two results about this topic. Since this day the Android app can't connect anymore with the backend.

Erik Zivkovic

unread,
Jun 11, 2015, 11:29:28 AM6/11/15
to google-a...@googlegroups.com
You can subclass GoogleIdTokenVerifier for now

package com.my.project.package;


import java.io.IOException;
import java.security.GeneralSecurityException;
import java.security.PublicKey;


import com.google.api.client.auth.openidconnect.IdTokenVerifier;
import com.google.api.client.googleapis.auth.oauth2.GoogleIdToken;
import com.google.api.client.googleapis.auth.oauth2.GoogleIdTokenVerifier;
import com.google.api.client.http.HttpTransport;
import com.google.api.client.json.JsonFactory;


@Deprecated
public class GoogleIdTokenVerifier2 extends GoogleIdTokenVerifier {


   
public GoogleIdTokenVerifier2(HttpTransport transport, JsonFactory jsonFactory) {
       
super(transport, jsonFactory);
   
}


   
@Override
   
public boolean verify(GoogleIdToken googleIdToken) throws GeneralSecurityException, IOException {
       
// check the payload
       
if (!((IdTokenVerifier)this).verify(googleIdToken)) {
           
return false;
       
}
       
// verify signature
       
for (PublicKey publicKey : getPublicKeysManager().getPublicKeys()) {
           
try {
               
if (googleIdToken.verifySignature(publicKey)) {
                   
return true;
               
}
           
} catch (Exception e) {
               
System.err.println("Verify Token:" + e);
           
}
       
}
       
return false;
   
}
}



ivbar bar

unread,
Jun 11, 2015, 11:45:35 AM6/11/15
to google-a...@googlegroups.com
Looks like it will not work with app engine + cloud endpoints. 
Do you have solution for it?

Thanks

Tom Edge

unread,
Jun 11, 2015, 12:37:29 PM6/11/15
to google-a...@googlegroups.com
Does this work when using the cloud endpoints @Api annotations to declare endpoint api methods? I can't work out how to implement your workaround

Nathan Green

unread,
Jun 11, 2015, 2:23:59 PM6/11/15
to google-a...@googlegroups.com
Anyone have any updates on this? It has been down all day

Arun Nedun

unread,
Jun 11, 2015, 3:31:01 PM6/11/15
to google-a...@googlegroups.com
The issue now appears to be fixed for me..! Can someone else confirm this as well? Will do more checking now...


On Thursday, June 11, 2015 at 8:34:30 AM UTC-4, Erik Zivkovic wrote:

ivbar bar

unread,
Jun 11, 2015, 3:55:46 PM6/11/15
to google-a...@googlegroups.com
Yes, it's working now.
Ahh... 

Nhat Nguyen

unread,
Jun 11, 2015, 4:19:11 PM6/11/15
to google-a...@googlegroups.com
Confirmed, everything seems to be back to normal.

Douglas Meredith

unread,
Jun 11, 2015, 4:26:51 PM6/11/15
to google-a...@googlegroups.com
I'm still seeing the problem.  Did you guys have to bounce your instances or something to get things back on track?

Arun Nedun

unread,
Jun 11, 2015, 5:55:12 PM6/11/15
to google-a...@googlegroups.com
Right. Shutdown instance and clear cache.
Message has been deleted

Roel de Brouwer (werk)

unread,
Jun 12, 2015, 3:35:48 AM6/12/15
to google-a...@googlegroups.com
Is it  "Compute" --> "App Engine" --> "Instances" --> "Shutdown"
and  "Compute" --> "App Engine" --> "Memcache" --> "Flush cache"

Op vrijdag 12 juni 2015 09:29:50 UTC+2 schreef Roel de Brouwer (werk):
Can you tell me where I can do that in the Console? The person that build the backend of our app is not in the house today.

Reply all
Reply to author
Forward
0 new messages