Example #1
0
        /// <summary>
        ///     Creates an authentication link.
        /// </summary>
        /// <param name="clientId">The client identifier.</param>
        /// <param name="redirectUri">The redirect URI.</param>
        /// <param name="crestScope">The crest scope.</param>
        /// <returns>System.String.</returns>
        public string CreateAuthLink(string clientId, string redirectUri, CrestScope crestScope)
        {
            string url =
                BaseUri + "/oauth/authorize/?response_type=code&redirect_uri=" + redirectUri + "&client_id=" + clientId +
                "&scope=" + resolveScope(crestScope);

            return(url);
        }
Example #2
0
        private static string resolveScope(CrestScope crestScope)
        {
            switch (crestScope)
            {
            case CrestScope.None:
                return("");

            case CrestScope.PublicData:
                return("publicData");
            }
            return("");
        }
Example #3
0
 /// <summary>
 ///     Creates an authentication link.
 /// </summary>
 /// <param name="clientId">The client identifier.</param>
 /// <param name="redirectUri">The redirect URI.</param>
 /// <param name="crestScope">The crest scope.</param>
 /// <param name="state"></param>
 /// <returns>System.String.</returns>
 public string CreateAuthLink(string clientId, string redirectUri, CrestScope crestScope, string state = "defaultState") {
     string url =
         BaseUri + "/oauth/authorize/?response_type=code&redirect_uri=" + redirectUri + "&client_id=" + clientId +
         "&scope=" + resolveScope(crestScope) + "&state=" + state;
     return url;
 }
Example #4
0
 private static string resolveScope(CrestScope crestScope) {
     switch (crestScope) {
         case CrestScope.None:
             return "";
         case CrestScope.PublicData:
             return "publicData";
     }
     return "";
 }