Giter VIP home page Giter VIP logo

google-saml-request's Introduction

NAME

Google::SAML::Request - Create or parse Google's SAML requests

VERSION

You are currently reading the documentation for version 0.05

DESCRIPTION

Google::SAML::Request will parse (and, for the sake of completeness, create) SAML requests as used by Google. Please note that Google::SAML::Request is by no means a full implementation of the SAML 2.0 standard. But if you want to talk to Google to authenticate users, you should be fine.

In fact, if you want to talk to Google about SSO, just use Google::SAML::Response and you should be fine.

SYNOPSIS

Create a new request object by taking the request ouf of the CGI environment:

use Google::SAML::Request;
my $req = Google::SAML::Request->new_from_cgi();
if ( $req->ProviderName() eq 'google.com'
   && $req->AssertionConsumerServiceURL() eq 'https://www.google.com/hosted/psosamldemo.net/acs' ) {

   processRequest();
}
else {
    print "go talk to someone else\n";
}

Or use a request string that you get from somewhere else (but make sure that it is no longer URI-escaped):

use Google::SAML::Request;
my $req = Google::SAML::Request->new_from_string( $request_string );
if ( $req->ProviderName() eq 'google.com'
   && $req->AssertionConsumerServiceURL() eq 'https://www.google.com/hosted/psosamldemo.net/acs' ) {

   processRequest();
}
else {
    print "go talk to someone else\n";
}

Or, finally, create a request from scratch and send that to somebody else:

use Google::SAML::Request;
my $req = Google::SAML::Request->new(
           {
               ProviderName => 'me.but.invalid',
               AssertionConsumerServiceURL => 'http://send.your.users.here.invalid/script',
           }
          );

PREREQUISITES

You will need the following modules installed:

METHODS

new

Create a new Google::SAML::Request object from scratch.

You have to provide the needed parameters here. Some parameters are optional and defaults are used if they are not supplied.

The parameters need to be passed in in a hash reference as key value pairs.

Required parameters

Optional parameters

  • IssueInstant

    The time stamp for the Request. Default is now.

  • ID

    If you need to create the ID yourself, use this option. Otherwise the ID is generated from the current time and a pseudo-random number.

new_from_cgi

Create a new Google::SAML::Request object by fishing it out of the CGI environment.

If you provide a hash-ref with the key 'param_name' you can determine which cgi parameter to use. The default is 'SAMLRequest'.

new_from_string

Pass in a (uri_unescaped!) string that contains the request string. The string will be base64-unencoded, inflated and parsed. You'll get back a fresh Google::SAML::Response object if the string can be parsed.

get_xml

Returns the XML representation of the request.

get_get_param

No, that's not a typo. This method will return the request in a form suitable to be used as a GET parameter. In other words, this method will take the XML representation, compress it, base64-encode the result and, finally, URI-escape that.

Accessor methods (read-only)

All of the following accessor methods return the value of the attribute with the same name

AssertionConsumerServiceURL

ID

IssueInstant

ProtocolBinding

ProviderName

Version

SOURCE CODE

This module has a repository on github. Pull requests are welcome.

https://github.com/mannih/Google-SAML-Request/

AUTHOR

Manni Heumann (saml at lxxi dot org)

LICENSE

Copyright (c) 2008 Manni Heumann. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

google-saml-request's People

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.