Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable custom TokenResponse for TokenRequest #194

Merged
merged 4 commits into from Oct 2, 2018

Conversation

@chingor13
Copy link
Collaborator

commented Jul 23, 2018

This PR does 2 things:

  1. Allow you to specify a TokenResponse subclass class when configuring a TokenRequest. This will allow you to write a custom TokenResponse subclass that can handle different OAuth authorize response parameters such as string JSON values for the expires_in field.
  2. Allows you to override the basic TokenResponse JSON values in subclasses. This will solve #62 by letting you specify your own strictly defined subclass of TokenResponse that matches your OAuth server's auth response.

Fixes #188
Fixes #62

@chingor13 chingor13 requested a review from google/yoshi-java Jul 23, 2018
@jadekler jadekler removed the do not merge label Aug 2, 2018
@jadekler

This comment has been minimized.

Copy link
Member

commented Aug 2, 2018

I'm probably not educated enough on this change to do a meaningful review. If you can't find anyone, though, let me know.

@chingor13 chingor13 force-pushed the chingor13:custom-token-response-flow branch from 5fadef8 to eb4d10e Aug 2, 2018
@chingor13 chingor13 requested a review from garrettjonesgoogle Aug 31, 2018
@chingor13 chingor13 changed the base branch from dev to master Sep 19, 2018
}

/**
* @param transport HTTP transport

This comment has been minimized.

Copy link
@elharo

elharo Sep 19, 2018

Collaborator

fill in Javadoc or delete

/**
* Sets the TokenResponse class to allow specifying object parsing.
*
* @param responseClass

This comment has been minimized.

Copy link
@elharo

elharo Sep 19, 2018

Collaborator

fill in Javadoc or delete

@@ -0,0 +1,81 @@
/*
* Copyright (c) 2018 Google Inc.

This comment has been minimized.

Copy link
@elharo

elharo Sep 19, 2018

Collaborator

no (c) in copyright

This comment has been minimized.

Copy link
@elharo

elharo Sep 19, 2018

Collaborator

Inc. --> LLC.

This comment has been minimized.

Copy link
@chingor13

chingor13 Sep 19, 2018

Author Collaborator

This was following the pattern of the other files. We can fix the others in a separate PR.

*/
public class CustomTokenRequestTest extends TestCase {

static final MockHttpTransport TRANSPORT = new MockHttpTransport();

This comment has been minimized.

Copy link
@elharo

elharo Sep 19, 2018

Collaborator

These could be private

@@ -0,0 +1,59 @@
/*
* Copyright (c) 2018 Google Inc.

This comment has been minimized.

Copy link
@elharo

elharo Sep 19, 2018

Collaborator

fix copyright

@googlebot googlebot added the cla: yes label Sep 27, 2018
@chingor13 chingor13 merged commit 7b5f86a into googleapis:master Oct 2, 2018
4 checks passed
4 checks passed
Kokoro - Test: Java 10 Build successful
Details
Kokoro - Test: Java 7 Build successful
Details
Kokoro - Test: Java 8 Build successful
Details
cla/google All necessary CLAs are signed
@chingor13 chingor13 deleted the chingor13:custom-token-response-flow branch Oct 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.