nabeelmukhtar / github-java-sdk

This project aims to provide a Java wrapper for Github API.
http://develop.github.com/
64 stars 22 forks source link

Pattern to parse accessToken includes newline character #6

Closed thallgren closed 13 years ago

thallgren commented 13 years ago

I receive strings ending with a newline character when using the OAuthService.getAccessToken() method. The authentication fails unless the newline is removed. The reason is this pattern in ApplicationConstants.properties:

com.github.api.v2.services.accessTokenPattern=access_token=([^&]+)(&expires=(\\d+))?

I tried changing the pattern to:

access_token=(\\w+)(&expires=(\\d+))?

and that works.

nabeelmukhtar commented 13 years ago

Thanks for pointing this out. I have fixed this in the master branch.