AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Comunicación / Gestión del protocolo OAuth 2.0
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
WLanguage procedure (also called "Callback") called during authentication. This type of procedure can be called:
This procedure can be a local, global or internal procedure.
Example
// Exemple permettant de récupérer un token pour effectuer une requête sur Dropbox
OAuth2Params is OAuth2Parameters
OAuth2Params.ClientID = "01234567890123456789" 
OAuth2Params.ClientSecret = "98765432109876543210"
OAuth2Params.AuthURL = "https://www.dropbox.com/oauth2/authorize"
OAuth2Params.TokenURL = "https://api.dropboxapi.com/oauth2/token"
OAuth2Params.AdditionalParameters = "force_reapprove=false"

// Demande d'authentification : ouvre la fenêtre de login
AuthIdentify(OAuth2Params, AuthIdentifie_Callback)

	INTERNAL PROCEDURE AuthIdentifie_Callback(bRésultat is boolean, MonToken is AuthToken)
		IF bRésultat = True THEN
			// Requête authentifiée sur une API de Dropbox
			req is httpRequest
			req.Method = httpPost
			req.URL = "https://api.dropboxapi.com/2/files/list_folder"
			req.AuthToken = MonToken // Token d'authentification
			req.ContentType = "application/json"
			vParamAPI is Variant
			vParamAPI.path = "/Homework/math"
			vParamAPI.recursive = False
			vParamAPI.include_media_info = False
			vParamAPI.include_deleted = False
			vParamAPI.include_has_explicit_shared_members = False
			req.Content = VariantToJSON(vParamAPI)

			réponseHTTP is httpResponse = HTTPSend(req)
			let Données = JSONToVariant(réponseHTTP.Content)
			// Utilisation des données reçues ...
		END
	END
Syntax
Callback_Authentication(<Success> , <Token>)
<Success>: Boolean
  • True if authentication has been completed,
  • False otherwise.
<Token>: AuthToken variable
AuthToken variable corresponding to the token containing the access information for the next requests that require authentication.
Business / UI classification: Neutral code
Component: wd300ggl.dll
Versión mínima requerida
  • Versión 25
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 02/04/2025

Señalar un error o enviar una sugerencia | Ayuda local