API-Handle

 view release on metacpan or  search on metacpan

config/google/dfp/auth/private/client.yml  view on Meta::CPAN

---
id: qwrqwrqwrqwr@23424242342.apps.googleusercontent.com
secret: a124124124124

config/openx/oauth/private/config.yml  view on Meta::CPAN

---
email: blah@blah.com
password: blahblah1
api_key: 123348234
api_secret: 1203123

lib/API/Handle/Google/DFP.pm  view on Meta::CPAN

	elsif ( $conf->{auth}{token}{refresh_token} ) {
		my $req = new HTTP::Request;

		$req->headers->header( 'Content-Type' => 'application/x-www-form-urlencoded' );
		$req->method( 'POST' );
		$req->uri( $conf->{auth}{uri}{token} );

		my $data = $self->_encode( type => 'form', data => {
			grant_type => 'refresh_token'
			, client_id => $conf->{auth}{client}{id}
			, client_secret => $conf->{auth}{client}{secret}
			, refresh_token => $conf->{auth}{token}{refresh_token}
		} );

		$req->content( $data );

		my $res = $self->ua->request( $req );

		if ( $res->code == 200 ) {
			my $data = $self->_decode( type => 'json', data => $res->content );
			$data->{expires_at} = time + $data->{expires_in};



( run in 0.594 second using v1.01-cache-2.11-cpan-39bf76dae61 )