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

Add ID token verification helpers. #82

Merged
merged 2 commits into from
Nov 10, 2016
Merged

Add ID token verification helpers. #82

merged 2 commits into from
Nov 10, 2016

Conversation

theacodes
Copy link
Contributor

Resolves #39 and the v1.0.0 milestone.

@theacodes theacodes added this to the 1.0.0 milestone Nov 10, 2016
Copy link
Contributor

@dhermes dhermes left a comment

Choose a reason for hiding this comment

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

LGTM. Don't you want to return a boolean instead of the actual certs?

'/securetoken@system.gserviceaccount.com')


def _fetch_certs(request, certs_url):

This comment was marked as spam.

This comment was marked as spam.

raise exceptions.TransportError(
'Could not fetch certificates at {}'.format(certs_url))

return json.loads(response.data.decode('utf-8'))

This comment was marked as spam.

This comment was marked as spam.

id_token (Union[str, bytes]): The encoded token.
request (google.auth.transport.Request): The object used to make
HTTP requests.
audience (str): The audience that this token is intended for. If None

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

HTTP requests.
audience (str): The audience that this token is intended for. If None
then the audience is not verified.
certs_url (str): The URL that specifies the certificates to use to

This comment was marked as spam.

id_token (Union[str, bytes]): The encoded token.
request (google.auth.transport.Request): The object used to make
HTTP requests.
audience (str): The audience that this token is intended for. This is

This comment was marked as spam.

Mapping[str, Any]: The decoded token.

Raises:
ValueError: if verification fails.

This comment was marked as spam.

This comment was marked as spam.

Mapping[str, Any]: The decoded token.

Raises:
ValueError: if verification fails.

This comment was marked as spam.

certs_url=_GOOGLE_OAUTH2_CERTS_URL)


def verify_firebase_token(id_token, request, audience=None):

This comment was marked as spam.

This comment was marked as spam.

response = mock.Mock()
response.status = status

if data is not None:

This comment was marked as spam.

This comment was marked as spam.

@theacodes theacodes merged commit e2ab100 into master Nov 10, 2016
@theacodes theacodes deleted the id-token branch November 10, 2016 23:11
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

2 participants