GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — EspAuthenticator does not work for google_id_token · Issue #590 · GoogleCloudPlatform/java-docs-samples

EspAuthenticator does not work for google_id_token #590

New issue
Copy link
New issue
Copy link
Closed
Closed
EspAuthenticator does not work for google_id_token#590
Copy link
Assignees
frankyn

Description

@gbhall
gbhall
opened on Apr 5, 2017
Issue body actions

Based on https://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/appengine/endpoints-frameworks-v2/backend/src/main/java/com/example/echo/Echo.java#L128

  @ApiMethod(
      httpMethod = ApiMethod.HttpMethod.GET,
      authenticators = {EspAuthenticator.class},
      audiences = {"YOUR_OAUTH_CLIENT_ID"},
      clientIds = {"YOUR_OAUTH_CLIENT_ID"}
      )
  public Email getUserEmail(User user) throws UnauthorizedException {
    if (user == null) {
      throw new UnauthorizedException("Invalid credentials");
    }

    Email response = new Email();
    response.setEmail(user.getEmail());
    return response;
  }

I receive a 401 "Invalid credentials" response unless I delete the line authenticators = {EspAuthenticator.class},, in which case once EspAuthenticator is removed it continues to work.

Tested using API Explorer.

I get the following error in Stackdriver:

com.google.api.server.spi.auth.EspAuthenticator authenticate: Authentication failed: com.google.common.util.concurrent.UncheckedExecutionException: com.google.api.auth.UnauthenticatedException: org.jose4j.jwt.consumer.InvalidJwtException: Unable to process JOSE object (cause: org.jose4j.lang.JoseException: Invalid JOSE Compact Serialization. Expecting either 3 or 5 parts for JWS or JWE respectively but was 2.): ya29.GlsjBAwcRb-NJa5B8rhIKPRRFr0xr06r9wbQ5DeeUE9qGxjPBWCVTxWj-9Lj390czP75kbS_7Jp5kv5lTtVHp4AYodU_JoJez-9SELB_L1GXgiW58GdIY29g1exE (EspAuthenticator.java:86)

Activity

  1. gbhall commented on Apr 5, 2017

    @gbhall
    gbhall
    on Apr 5, 2017
    Author
    More actions

    Please see https://stackoverflow.com/questions/43218379/authenticating-users-using-firebase-and-google-on-cloud-endpoints-and-api-expl for more.

  2. lesv commented on Apr 22, 2017

    @lesv
    lesv
    on Apr 22, 2017
    Contributor
    More actions

    @frankyn PTAL

  3. frankyn
    self-assigned this
    on Apr 22, 2017
  4. frankyn commented on Apr 22, 2017

    @frankyn
    frankyn
    on Apr 22, 2017
    Contributor
    More actions

    Hi @gbhall!

    After reading, it seems the stack overflow response was able to solve your issue.

    Please feel free to reopen if this persists or file new issues!

  5. frankyn
    closed this as completedon Apr 22, 2017
  6. minherz
    added a commit that references this issue on Nov 9, 2022

    chore(deps): update dependency com.google.cloud:libraries-bom to v20.…

    6a6464b
  7. Shabirmean
    added 4 commits that reference this issue on Nov 9, 2022

    chore(deps): update dependency com.google.cloud:libraries-bom to v24.…

    9d2aad5

    chore(deps): update dependency com.google.cloud:libraries-bom to v24.…

    f537cc3

    chore(deps): update dependency com.google.cloud:libraries-bom to v24.…

    35ca506

    chore(deps): update dependency com.google.cloud:libraries-bom to v24.…

    14e5d29
  8. minherz
    added 2 commits that reference this issue on Nov 10, 2022

    chore(deps): update dependency com.google.cloud:libraries-bom to v20.…

    92c2c46

    chore(deps): update dependency com.google.cloud:libraries-bom to v20.…

    951e43d
  9. olivi-eh
    added a commit that references this issue on Nov 11, 2022

    chore(deps): update dependency com.google.cloud:google-cloud-notifica…

    e48267f
  10. Shabirmean
    added 4 commits that reference this issue on Nov 14, 2022

    deps: update dependency com.google.cloud:google-cloud-core to v1.95.2 (…

    6e50526

    deps: update dependency com.google.cloud:google-cloud-core to v1.95.2 (…

    b38de4d

    chore(deps): update dependency com.google.cloud:libraries-bom to v21 (#…

    253bf38

    chore(deps): update dependency com.google.cloud:libraries-bom to v21 (#…

    4f7c032
  11. minherz
    added 2 commits that reference this issue on Nov 16, 2022

    chore(deps): update dependency com.google.cloud:libraries-bom to v19 (#…

    8c71281

    chore(deps): update dependency com.google.cloud:libraries-bom to v19 (#…

    6314950
  12. anguillanneuf
    added a commit that references this issue on Dec 5, 2022

    chore(deps): update dependency com.google.cloud:libraries-bom to v19 (#…

    726ba96
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @frankyn
    frankyn

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.