コード例 #1
0
ファイル: OpenIdTest.cs プロジェクト: PieterScheffers/FotoLab
        public void TestUserinfoDynamic()
        {
            Dictionary<string, string> configurationMap = new Dictionary<string, string>();
            configurationMap.Add("clientId", "");
            configurationMap.Add("clientSecret", "");
            configurationMap.Add("mode", "live");
            APIContext apiContext = new APIContext();
            apiContext.Config = configurationMap;

            UserinfoParameters userinfoParams = new UserinfoParameters();
            userinfoParams.SetAccessToken(info.access_token);
            Userinfo userinfo = Userinfo.GetUserinfo(apiContext, userinfoParams);
            Assert.AreEqual(userinfo != null, true);
        }
コード例 #2
0
        /// <summary>
        /// Returns user details
        /// <param name="apiContext">APIContext to be used for the call.</param>
        /// <param name="userinfoParameters">Query parameters used for API call</param>
        /// </summary>
        public static Userinfo GetUserinfo(APIContext apiContext, UserinfoParameters userinfoParameters)
        {
            string pattern = "v1/identity/openidconnect/userinfo?schema={0}&access_token={1}";

            object[] parameters   = new object[] { userinfoParameters };
            string   resourcePath = SDKUtil.FormatURIPath(pattern, parameters);
            string   payLoad      = "";

            if (apiContext == null)
            {
                apiContext = new APIContext();
            }
            apiContext.MaskRequestId = true;
            return(PayPalResource.ConfigureAndExecute <Userinfo>(apiContext, HttpMethod.GET, resourcePath, payLoad));
        }
コード例 #3
0
ファイル: Userinfo.cs プロジェクト: PieterScheffers/FotoLab
 /// <summary>
 /// Returns user details
 /// <param name="apiContext">APIContext to be used for the call.</param>
 /// <param name="userinfoParameters">Query parameters used for API call</param>
 /// </summary>
 public static Userinfo GetUserinfo(APIContext apiContext, UserinfoParameters userinfoParameters)
 {
     string pattern = "v1/identity/openidconnect/userinfo?schema={0}&access_token={1}";
     object[] parameters = new object[] { userinfoParameters };
     string resourcePath = SDKUtil.FormatURIPath(pattern, parameters);
     string payLoad = "";
     if (apiContext == null)
     {
         apiContext = new APIContext();
     }
     apiContext.MaskRequestId = true;
     return PayPalResource.ConfigureAndExecute<Userinfo>(apiContext, HttpMethod.GET, resourcePath, payLoad);
 }
コード例 #4
0
 /// <summary>
 /// Returns user details
 /// <param name="userinfoParameters">Query parameters used for API call</param>
 /// </summary>
 public static Userinfo GetUserinfo(UserinfoParameters userinfoParameters)
 {
     return(GetUserinfo(null, userinfoParameters));
 }
コード例 #5
0
ファイル: Userinfo.cs プロジェクト: PieterScheffers/FotoLab
 /// <summary>
 /// Returns user details
 /// <param name="userinfoParameters">Query parameters used for API call</param>
 /// </summary>
 public static Userinfo GetUserinfo(UserinfoParameters userinfoParameters)
 {
     return GetUserinfo(null, userinfoParameters);
 }