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

TFJ-762 add Application-only authentication feature. #101

Merged
merged 2 commits into from Jun 13, 2013

Conversation

komiya-atsushi
Copy link
Contributor

  • Added files
    • twitter4j-core/src/main/java/twitter4j/auth
      • OAuth2Support.java (Interface)
      • OAuth2Authorization.java (Impl. of OAuth2Support interface)
      • OAuth2Token.java (Class)
    • twitter4j-core/src/test/java/twitter4j/auth
      • ApplicationOnlyAuthTest.java (Test cases of Application-only authentication)
  • Added configurations
    • oauth2.tokenType ... Specify 'bearer'.
    • oauth2.accessToken ... Specify obtained OAuth 2 Bearer token.
    • oauth2.tokenURL ... Specify endpoint of obtaining OAuth 2 Bearer token.
    • oauth2.invalidateTokenURL ... Specify endpoint of revoking OAuth 2 Bearer token.
    • enableApplicationOnlyAuth ... Specify true if you want to use Application-only authentication.

@komiya-atsushi
Copy link
Contributor Author

I added license notice and @author to some files.

OAuth2Authorization is implementing OAuthAuthorization. Do we really need this change?

OAuth2Authorization is not a subclass of OAuthAuthorization (and also not implement OAuthSupport), so this change is needed.

@yusuke
Copy link
Collaborator

yusuke commented Jun 13, 2013

LGTM!

yusuke added a commit that referenced this pull request Jun 13, 2013
TFJ-762 add Application-only authentication feature.
@yusuke yusuke merged commit a014b8f into Twitter4J:master Jun 13, 2013
return "OAuth2Authorization{" +
"consumerKey='" + consumerKey + '\'' +
", consumerSecret='******************************************\'" +
", token=" + token.toString() +
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This toString() function throws a null pointer exception when called before getOAuth2Token(). IMHO you should strongly considering checking for token==null before calling token.toString()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants