1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
Класс WindowsLiveLogin

Открытые члены

 setDebug ($debug)
 debug ($string)
 fatal ($string)
 __construct ( $appid=null, $secret=null, $securityalgorithm=null, $force_delauth_nonprovisioned=null, $policyurl=null, $returnurl=null)
 initFromXml ($settingsFile)
 setAppId ($appid)
 getAppId ()
 setSecret ($secret)
 setOldSecret ($secret)
 setOldSecretExpiry ($timestamp)
 getOldSecretExpiry ()
 setSecurityAlgorithm ($securityalgorithm)
 getSecurityAlgorithm ()
 setForceDelAuthNonProvisioned ($force_delauth_nonprovisioned)
 setPolicyUrl ($policyurl)
 getPolicyUrl ()
 setReturnUrl ($returnurl)
 getReturnUrl ()
 setBaseUrl ($baseurl)
 getBaseUrl ()
 setSecureUrl ($secureurl)
 getSecureUrl ()
 setConsentBaseUrl ($consenturl)
 getConsentBaseUrl ()
 getLoginUrl ($context=null, $market=null)
 getLogoutUrl ($market=null)
 processLogin ($query)
 processToken ($token, $context=null)
 getClearCookieResponse ()
 getConsentUrl ($offers, $context=null, $ru=null, $market=null)
 getRefreshConsentTokenUrl ($offers, $refreshtoken, $ru=null)
 getManageConsentUrl ($market=null)
 processConsent ($query)
 processConsentToken ($token, $context=null)
 refreshConsentToken ($token, $ru=null)
 refreshConsentToken2 ($offers_string, $refreshtoken, $ru=null)
 decodeAndValidateToken ($token, $cryptkey=null, $signkey=null, $internal_allow_recursion=true)
 decodeToken ($token, $cryptkey=null)
 signToken ($token, $signkey=null)
 validateToken ($token, $signkey=null)
 getAppVerifier ($ip=null)
 getAppLoginUrl ($siteid=null, $ip=null, $js=null)
 getAppSecurityToken ($siteid=null, $ip=null)
 getAppRetCode ()
 getTrustedParams ($user, $retcode=null)
 getTrustedToken ($user)
 getTrustedLoginUrl ()
 getTrustedLogoutUrl ()
 parseSettings ($settingsFile)
 derive ($secret, $prefix)
 parse ($input)
 getTimestamp ()
 e64 ($input)
 u64 ($input)
 fetch ($url)
 setError ($str)
 getError ()
 OnExternalAuthList ()

Открытые статические члены

static IsAvailable ()

Поля данных

 $_debug = false
 $_appid
 $_signkey
 $_cryptkey
 $_oldsignkey
 $_oldcryptkey
 $_oldsecretexpiry
 $_securityalgorithm
 $_force_delauth_nonprovisioned
 $_policyurl
 $_returnurl
 $_baseurl
 $_secureurl
 $_consenturl
 $_error = false

Подробное описание

См. определение в файле liveid.php строка 526

Конструктор(ы)

◆ __construct()

__construct ( $appid = null,
$secret = null,
$securityalgorithm = null,
$force_delauth_nonprovisioned = null,
$policyurl = null,
$returnurl = null )

Initialize the WindowsLiveLogin module with the application ID, secret key, and security algorithm.

We recommend that you employ strong measures to protect the secret key. The secret key should never be exposed to the Web or other users.

Be aware that if you do not supply these settings at initialization time, you may need to set the corresponding properties manually.

For Delegated Authentication, you may optionally specify the privacy policy URL and return URL. If you do not specify these values here, the default values that you specified when you registered your application will be used.

The 'force_delauth_nonprovisioned' flag also indicates whether your application is registered for Delegated Authentication (that is, whether it uses an application ID and secret key). We recommend that your Delegated Authentication application always be registered for enhanced security and functionality.

См. определение в файле liveid.php строка 593

Методы

◆ debug()

debug ( $string)

Stub implementation for logging errors. By default, this function does nothing if the debug flag has not been set with setDebug. Otherwise, errors are logged using the PHP error_log function.

См. определение в файле liveid.php строка 551

◆ decodeAndValidateToken()

decodeAndValidateToken ( $token,
$cryptkey = null,
$signkey = null,
$internal_allow_recursion = true )

См. определение в файле liveid.php строка 1331

◆ decodeToken()

decodeToken ( $token,
$cryptkey = null )

Decodes the given token string; returns undef on failure.

First, the string is URL-unescaped and base64 decoded. Second, the IV is extracted from the first 16 bytes of the string. Finally, the string is decrypted using the encryption key.

См. определение в файле liveid.php строка 1376

◆ derive()

derive ( $secret,
$prefix )

Derives the key, given the secret key and prefix as described in the Web Authentication SDK documentation.

См. определение в файле liveid.php строка 1682

◆ e64()

e64 ( $input)

Base64-encodes and URL-escapes a string.

См. определение в файле liveid.php строка 1744

◆ fatal()

fatal ( $string)

Stub implementation for handling a fatal error.

См. определение в файле liveid.php строка 563

◆ fetch()

fetch ( $url)

Fetches the contents given a URL.

См. определение в файле liveid.php строка 1767

◆ getAppId()

getAppId ( )

Returns the application ID.

См. определение в файле liveid.php строка 699

◆ getAppLoginUrl()

getAppLoginUrl ( $siteid = null,
$ip = null,
$js = null )

Returns the URL that is required to retrieve the application security token.

By default, the application security token is generated for the Windows Live site; a specific Site ID can optionally be specified in 'siteid'. The IP address can also optionally be included in 'ip'.

If 'js' is nil, a JavaScript Output Notation (JSON) response is returned in the following format:

{"token":"<value>"}

Otherwise, a JavaScript response is returned. It is assumed that WLIDResultCallback is a custom function implemented to handle the token value:

WLIDResultCallback("<tokenvalue>");

См. определение в файле liveid.php строка 1501

◆ getAppRetCode()

getAppRetCode ( )

Returns a string that can be passed to the getTrustedParams function as the 'retcode' parameter. If this is specified as the 'retcode', the application will be used as return URL after it finishes trusted sign-in.

См. определение в файле liveid.php строка 1554

◆ getAppSecurityToken()

getAppSecurityToken ( $siteid = null,
$ip = null )

Retrieves the application security token for application verification from the application sign-in URL.

By default, the application security token will be generated for the Windows Live site; a specific Site ID can optionally be specified in 'siteid'. The IP address can also optionally be included in 'ip'.

Implementation note: The application security token is downloaded from the application sign-in URL in JSON format:

{"token":"<value>"}

Therefore we must extract

from the string and return it as seen here.

См. определение в файле liveid.php строка 1529

◆ getAppVerifier()

getAppVerifier ( $ip = null)

Generates an application verifier token. An IP address can optionally be included in the token.

См. определение в файле liveid.php строка 1472

◆ getBaseUrl()

getBaseUrl ( )

Gets the base URL to use for the Windows Live Login server. You should not have to use this property. Furthermore, we recommend that you use the Sign In control instead of the URL methods provided here.

См. определение в файле liveid.php строка 934

◆ getClearCookieResponse()

getClearCookieResponse ( )

Returns an appropriate content type and body response that the application handler can return to signify a successful sign-out from the application.

When a user signs out of Windows Live or a Windows Live application, a best-effort attempt is made at signing the user out from all other Windows Live applications the user might be signed in to. This is done by calling the handler page for each application with 'action' set to 'clearcookie' in the query string. The application handler is then responsible for clearing any cookies or data associated with the sign-in. After successfully signing the user out, the handler should return a GIF (any GIF) image as response to the 'action=clearcookie' query.

См. определение в файле liveid.php строка 1114

◆ getConsentBaseUrl()

getConsentBaseUrl ( )

Gets the URL to use for the Windows Live Consent server. You should not have to use or change this directly.

См. определение в файле liveid.php строка 988

◆ getConsentUrl()

getConsentUrl ( $offers,
$context = null,
$ru = null,
$market = null )

См. определение в файле liveid.php строка 1139

◆ getError()

getError ( )

См. определение в файле liveid.php строка 1800

◆ getLoginUrl()

getLoginUrl ( $context = null,
$market = null )

Returns the sign-in URL to use for the Windows Live Login server. We recommend that you use the Sign In control instead.

If you specify it, 'context' will be returned as-is in the sign-in response for site-specific use.

См. определение в файле liveid.php строка 1007

◆ getLogoutUrl()

getLogoutUrl ( $market = null)

Returns the sign-out URL to use for the Windows Live Login server. We recommend that you use the Sign In control instead.

См. определение в файле liveid.php строка 1022

◆ getManageConsentUrl()

getManageConsentUrl ( $market = null)

См. определение в файле liveid.php строка 1203

◆ getOldSecretExpiry()

getOldSecretExpiry ( )

Gets the old secret key expiry time.

См. определение в файле liveid.php строка 795

◆ getPolicyUrl()

getPolicyUrl ( )

Gets the privacy policy URL for your site.

См. определение в файле liveid.php строка 861

◆ getRefreshConsentTokenUrl()

getRefreshConsentTokenUrl ( $offers,
$refreshtoken,
$ru = null )

См. определение в файле liveid.php строка 1168

◆ getReturnUrl()

getReturnUrl ( )

Returns the return URL of your site.

См. определение в файле liveid.php строка 900

◆ getSecureUrl()

getSecureUrl ( )

Gets the secure (HTTPS) URL to use for the Windows Live Login server. You should not have to use this functon directly.

См. определение в файле liveid.php строка 961

◆ getSecurityAlgorithm()

getSecurityAlgorithm ( )

Gets the version of the security algorithm being used.

См. определение в файле liveid.php строка 816

◆ getTimestamp()

getTimestamp ( )

Generates a time stamp suitable for the application verifier token.

См. определение в файле liveid.php строка 1735

◆ getTrustedLoginUrl()

getTrustedLoginUrl ( )

Returns the trusted sign-in URL to use for Windows Live Login server.

См. определение в файле liveid.php строка 1620

◆ getTrustedLogoutUrl()

getTrustedLogoutUrl ( )

Returns the trusted sign-in URL to use for Windows Live Login server.

См. определение в файле liveid.php строка 1630

◆ getTrustedParams()

getTrustedParams ( $user,
$retcode = null )

Returns a table of key-value pairs that must be posted to the sign-in URL for trusted sign-in. Use HTTP POST to do this. Be aware that the values in the table are neither URL nor HTML escaped and may have to be escaped if you are inserting them in code such as an HTML form.

The user to be trusted on the local site is passed in as string 'user'.

Optionally, 'retcode' specifies the resource to which successful sign-in is redirected, such as Windows Live Mail, and is typically a string in the format 'id=2000'. If you pass in the value from getAppRetCode instead, sign-in will be redirected to the application. Otherwise, an HTTP 200 response is returned.

См. определение в файле liveid.php строка 1576

◆ getTrustedToken()

getTrustedToken ( $user)

Returns the trusted sign-in token in the format that is needed by a control doing trusted sign-in.

The user to be trusted on the local site is passed in as string 'user'.

См. определение в файле liveid.php строка 1603

◆ initFromXml()

initFromXml ( $settingsFile)

Initialize the WindowsLiveLogin module from a settings file.

'settingsFile' specifies the location of the XML settings file that contains the application ID, secret key, and security algorithm. The file is of the following format:

<windowslivelogin> <appid>APPID</appid> <secret>SECRET</secret> <securityalgorithm>wsignin1.0</securityalgorithm> </windowslivelogin>

In a Delegated Authentication scenario, you may also specify 'returnurl' and 'policyurl' in the settings file, as shown in the Delegated Authentication samples.

We recommend that you store the WindowsLiveLogin settings file in an area on your server that cannot be accessed through the Internet. This file contains important confidential information.

См. определение в файле liveid.php строка 640

◆ IsAvailable()

IsAvailable ( )
static

См. определение в файле liveid.php строка 1824

◆ OnExternalAuthList()

OnExternalAuthList ( )

См. определение в файле liveid.php строка 1808

◆ parse()

parse ( $input)

Parses query string and returns a hash.

If a hash ref is passed in from CGI->Var, it is dereferenced and returned.

См. определение в файле liveid.php строка 1708

◆ parseSettings()

parseSettings ( $settingsFile)

Function to parse the settings file.

См. определение в файле liveid.php строка 1641

◆ processConsent()

processConsent ( $query)

См. определение в файле liveid.php строка 1218

◆ processConsentToken()

processConsentToken ( $token,
$context = null )

См. определение в файле liveid.php строка 1241

◆ processLogin()

processLogin ( $query)

Processes the sign-in response from Windows Live Login server.

Аргументы
querycontains the preprocessed POST query, a map of Strings to an an array of Strings, such as that returned by ServletRequest.getParameterMap().
Возвращает
a User object on successful sign-in; otherwise null.

См. определение в файле liveid.php строка 1039

◆ processToken()

processToken ( $token,
$context = null )

Decodes and validates a Web Authentication token. Returns a User object on success. If a context is passed in, it will be returned as the context field in the User object.

См. определение в файле liveid.php строка 1057

◆ refreshConsentToken()

refreshConsentToken ( $token,
$ru = null )

См. определение в файле liveid.php строка 1293

◆ refreshConsentToken2()

refreshConsentToken2 ( $offers_string,
$refreshtoken,
$ru = null )

См. определение в файле liveid.php строка 1307

◆ setAppId()

setAppId ( $appid)

Sets the application ID. Use this method if you did not specify an application ID at initialization.

См. определение в файле liveid.php строка 680

◆ setBaseUrl()

setBaseUrl ( $baseurl)

Sets the base URL to use for the Windows Live Login server. You should not have to change this property. Furthermore, we recommend that you use the Sign In control instead of the URL methods provided here.

См. определение в файле liveid.php строка 922

◆ setConsentBaseUrl()

setConsentBaseUrl ( $consenturl)

Sets the Consent Base URL to use for the Windows Live Consent server. You should not have to use or change this property directly.

См. определение в файле liveid.php строка 978

◆ setDebug()

setDebug ( $debug)

Stub implementation for logging errors. If you want to enable debugging output, set this to true. In this implementation errors will be logged using the PHP error_log function.

См. определение в файле liveid.php строка 539

◆ setError()

setError ( $str)

См. определение в файле liveid.php строка 1795

◆ setForceDelAuthNonProvisioned()

setForceDelAuthNonProvisioned ( $force_delauth_nonprovisioned)

Sets a flag that indicates whether Delegated Authentication is non-provisioned (i.e. does not use an application ID or secret key).

См. определение в файле liveid.php строка 834

◆ setOldSecret()

setOldSecret ( $secret)

Sets your old secret key.

Use this property to set your old secret key if you are in the process of transitioning to a new secret key. You may need this property because the Windows Live ID servers can take up to 24 hours to propagate a new secret key after you have updated your application settings.

If an old secret key is specified here and has not expired (as determined by the oldsecretexpiry setting), it will be used as a fallback if token decryption fails with the new secret key.

См. определение в файле liveid.php строка 751

◆ setOldSecretExpiry()

setOldSecretExpiry ( $timestamp)

Sets the expiry time for your old secret key.

After this time has passed, the old secret key will no longer be used even if token decryption fails with the new secret key.

The old secret expiry time is represented as the number of seconds elapsed since January 1, 1970.

См. определение в файле liveid.php строка 777

◆ setPolicyUrl()

setPolicyUrl ( $policyurl)

Sets the privacy policy URL if you did not provide one at initialization time.

См. определение в файле liveid.php строка 846

◆ setReturnUrl()

setReturnUrl ( $returnurl)

Sets the return URL–the URL on your site to which the consent service redirects users (along with the action, consent token, and application context) after they have successfully provided consent information for Delegated Authentication. This value will override the return URL specified during registration.

См. определение в файле liveid.php строка 885

◆ setSecret()

setSecret ( $secret)

Sets your secret key. Use this method if you did not specify a secret key at initialization.

См. определение в файле liveid.php строка 717

◆ setSecureUrl()

setSecureUrl ( $secureurl)

Sets the secure (HTTPS) URL to use for the Windows Live Login server. You should not have to change this property.

См. определение в файле liveid.php строка 951

◆ setSecurityAlgorithm()

setSecurityAlgorithm ( $securityalgorithm)

Sets the version of the security algorithm being used.

См. определение в файле liveid.php строка 807

◆ signToken()

signToken ( $token,
$signkey = null )

Creates a signature for the given string by using the signature key.

См. определение в файле liveid.php строка 1405

◆ u64()

u64 ( $input)

URL-unescapes and Base64-decodes a string.

См. определение в файле liveid.php строка 1756

◆ validateToken()

validateToken ( $token,
$signkey = null )

Extracts the signature from the token and validates it.

См. определение в файле liveid.php строка 1426

Поля

◆ $_appid

$_appid

См. определение в файле liveid.php строка 673

◆ $_baseurl

$_baseurl

См. определение в файле liveid.php строка 913

◆ $_consenturl

$_consenturl

См. определение в файле liveid.php строка 971

◆ $_cryptkey

$_cryptkey

См. определение в файле liveid.php строка 710

◆ $_debug

$_debug = false

См. определение в файле liveid.php строка 531

◆ $_error

$_error = false

См. определение в файле liveid.php строка 1793

◆ $_force_delauth_nonprovisioned

$_force_delauth_nonprovisioned

См. определение в файле liveid.php строка 826

◆ $_oldcryptkey

$_oldcryptkey

См. определение в файле liveid.php строка 734

◆ $_oldsecretexpiry

$_oldsecretexpiry

См. определение в файле liveid.php строка 765

◆ $_oldsignkey

$_oldsignkey

См. определение в файле liveid.php строка 732

◆ $_policyurl

$_policyurl

См. определение в файле liveid.php строка 840

◆ $_returnurl

$_returnurl

См. определение в файле liveid.php строка 875

◆ $_secureurl

$_secureurl

См. определение в файле liveid.php строка 944

◆ $_securityalgorithm

$_securityalgorithm

См. определение в файле liveid.php строка 801

◆ $_signkey

$_signkey

См. определение в файле liveid.php строка 708


Объявления и описания членов класса находятся в файле:
  • C:/bitrix/modules/main/classes/general/liveid.php