PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
New WINDEV, WEBDEV 24 feature!
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
gpwAddAuthLogin (Function)
In french: gpwAjouteAuthLogin
Adds a log in button that represents a type of authentication (Facebook, Google, Microsoft, etc.) for the User Groupware in the login window or page.
Notes:
  • This setting is only allowed if the User Groupware is configured for manual run.
  • It is necessary to have previously registered the application in each service used.
Example
// Log in with Google
GoogleOpenIDParams is OpenIDParameters
GoogleOpenIDParams.ClientID = "106034950???????.apps.googleusercontent.com"
GoogleOpenIDParams.ClientSecret = "oBTQL??????MpiM"
gpwAddAuthLogin(GoogleOpenIDParams, gpwGoogle)

// Log in with Facebook
FacebookOAuthParams is OAuth2Parameters
FacebookOAuthParams.ClientID = "1702?????741"
FacebookOAuthParams.ClientSecret = "badf00d?????1ce8ecd"
gpwAddAuthLogin(FacebookOAuthParams, gpwFacebook)

// Log in with my custom domain
CustomOpenIDParams is OpenIDParameters
CustomOpenIDParams.ClientID = "1745?????4741"
CustomOpenIDParams.ClientSecret = "dbeefba?????1ce8ecd"
gpwAddAuthLogin(CustomOpenIDParams, "CustomDomain", fExeDir() + "\customdomain.png")

// Opens the login window of user groupware
nRes is int = gpwOpen()
// If the login failed
IF nRes <> gpwOk THEN
SWITCH nRes
CASE gpwCancel: Info("The Cancel button was clicked.")
CASE gpwError: Error("Error while initializing the groupware.")
CASE gpwUnknownUser: Error("Unknown user.")
CASE gpwInvalidPassword: Error("Invalid password")
END
EndProgram()
END
// Retrieve the first name of user
FirstName is string = gpwGetUserInfo(gpwInfoFirstName)
Info("Welcome, " + FirstName)
Syntax

Add a log in button to one of the services available by default Hide the details

gpwAddAuthLogin(<Type of authentication> , <Type>)
<Type of authentication>: OAuth2Parameters variable or OpenIDParameters variable
  • Name of a OAuth2Parameters variable to authenticate oneself on a Web service that uses the OAuth 2.0 standard.
  • Name of an OpenIDParameters variable to authenticate oneself on a Web service that uses the OpenID standard.
Note: the properties ..AuthURL, ..RedirectionURL and ..TokenURL are optional. The default URLs are used.
<Type>: Integer constant
Type of Webservice to use:
gpwFacebookUsing a Facebook account.
gpwGoogleUsing a Google Account.
gpwMicrosoftUsing a Microsoft MSN account.
gpwSalesforceUsing a Salesforce account.
gpwYahooUsing a Yahoo account.

Adding a custom login button Hide the details

gpwAddAuthLogin(<Type of authentication> , <Caption> [, <Image>])
<Type of authentication>: OAuth2Parameters variable or OpenIDParameters variable
  • Name of an OAuth2Parameters variable to authenticate oneself on a Web service that uses the OAuth 2.0 standard.
  • Name of an OpenIDParameters variable to authenticate oneself on a Web service that uses the OpenID standard.
<Caption>: Character string (with quotes)
Caption of the service displayed in the button.
<Image>: Optional character string with quotes
Name and path of the image file that corresponds to the service logo.
  • This image can be in one of the following formats: .ICO, .PNG, .JPG, .GIF.
  • Its size must be 24 x 24 pixels
Component : wd240gpu.dll
Minimum version required
  • Version 24
This page is also available for…
Comments
Click [Add] to post a comment