public static function createLoginURL(
      $destination_url = null, $federated_identity = null) {
    $req = new CreateLoginURLRequest();
    $resp = new CreateLoginURLResponse();
    if ($destination_url !== null) {
      $req->setDestinationUrl($destination_url);
    } else {
      $req->setDestinationUrl('');
    }
    if ($federated_identity !== null) {
      $req->setFederatedIdentity($federated_identity);
    }

    try {
      ApiProxy::makeSyncCall('user', 'CreateLoginURL', $req, $resp);
    } catch (ApplicationError $e) {
      throw self::applicationErrorToException(
          $e, htmlspecialchars($destination_url));
    }
    return $resp->getLoginUrl();
  }
public static function createLoginURL(
      $destination_url = null, $federated_identity = null) {
    $req = new CreateLoginURLRequest();
    $resp = new CreateLoginURLResponse();
    if ($destination_url !== null) {
      $req->setDestinationUrl($destination_url);
    } else {
      $req->setDestinationUrl('');
    }
    if ($federated_identity !== null) {
      $req->setFederatedIdentity($federated_identity);
    }

    try {
      ApiProxy::makeSyncCall('user', 'CreateLoginURL', $req, $resp);
    } catch (ApplicationError $e) {
      throw self::applicationErrorToException(
          $e, htmlspecialchars($destination_url));
    }
    return $resp->getLoginUrl();
  }
public static function createLoginURL ( $ destination_url = null , $ federated_identity = null ) { $ req = new CreateLoginURLRequest ( ) ; $ resp = new CreateLoginURLResponse ( ) ; if ( $ destination_url !== null ) { $ req -> setDestinationUrl ( $ destination_url ) ; } else { $ req -> setDestinationUrl ( '' ) ; } if ( $ federated_identity !== null ) { $ req -> setFederatedIdentity ( $ federated_identity ) ; } try { ApiProxy :: makeSyncCall ( 'user' , 'CreateLoginURL' , $ req , $ resp ) ; } catch ( ApplicationError $ e ) { throw self :: applicationErrorToException ( $ e , htmlspecialchars ( $ destination_url ) ) ; } return $ resp -> getLoginUrl ( ) ; }
Computes the login URL for redirection.

@param string $destination_url The desired final destination URL for the
user once login is complete. If 'destinationURL' does not
have a host specified, we will use the host from the
current request.

@param string $federated_identity The parameter is used to trigger OpenId
Login flow, an empty value will trigger Google OpenID Login
by default.

@return string Login URL. If federatedIdentity is set, this will be
a federated login using the specified identity. If not, this
will use Google Accounts.

@throws UsersException If there was a problem using the Users service.
Computes the login URL for redirection .