NAME

WebService::GoogleAPI::Client::AccessToken - A small class for bundling user and scopes with a token

VERSION

version 0.24_001

SYNOPSIS

  my $token = $gapi->get_access_token # returns this class
  # {
  #   token   => '...',
  #   user    => 'the-user-that-it's-for',
  #   scopes  => [ 'the', 'scopes', 'that', 'its', 'for' ]
  # }
  #
  my $res = ... # any api call here
  $res->{_token} # the token the call was made with

This is a simple class which contains the data related to a Google Cloud access token that bundles the related user and scopes.

It overloads stringification so that interpolating it in, say an auth header, will return just the token.

This is for introspection purposes, so if something goes wrong, you can check the response from your request and check the _token hash key on that object. Note that this is subject to change in future versions (there's probably a saner way to do this).

AUTHORS

  • Veesh Goldman <veesh@cpan.org>

  • Peter Scott <localshop@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2017-2021 by Peter Scott and others.

This is free software, licensed under:

  The Apache License, Version 2.0, January 2004