コード例 #1
0
        public async Task ReturnProtocolInformation()
        {
            //when
            var protocol = await ManifestInfo.GetProtocol();

            //then
            Assert.AreEqual("unit-test", protocol);
        }
コード例 #2
0
 private async static Task <ManifestInfo> GetInstance()
 {
     if (instance == null)
     {
         instance = new ManifestInfo();
         await instance.init();
     }
     return(instance);
 }
コード例 #3
0
 private static ManifestInfo GetInstance()
 {
     if (instance == null)
     {
         lock (syncRoot)
         {
             instance = new ManifestInfo();
             instance.document = instance.GetDocument();
         }
     }
     return instance;
 }
コード例 #4
0
 private static ManifestInfo GetInstance()
 {
     if (instance == null)
     {
         lock (syncRoot)
         {
             instance          = new ManifestInfo();
             instance.document = instance.GetDocument();
         }
     }
     return(instance);
 }
コード例 #5
0
        public static GoogleConfig Create(string clientId, IList <string> scopes, string accountId)
        {
            var protocol = ManifestInfo.GetProtocol();

            return(new GoogleConfig()
            {
                baseURL = "https://accounts.google.com/",
                authzEndpoint = "o/oauth2/auth",
                redirectURL = protocol + ":/oauth2Callback",
                accessTokenEndpoint = "o/oauth2/token",
                refreshTokenEndpoint = "o/oauth2/token",
                revokeTokenEndpoint = "rest/revoke",
                clientId = clientId,
                scopes = scopes,
                accountId = accountId
            });
        }
コード例 #6
0
        public static KeycloakConfig Create(string clientId, string host, string realm)
        {
            var protocol        = ManifestInfo.GetProtocol();
            var defaulRealmName = clientId + "-realm";
            var realmName       = realm != null ? realm : defaulRealmName;

            return(new KeycloakConfig()
            {
                baseURL = host + "/auth/",
                authzEndpoint = string.Format("realms/{0}/tokens/login", realmName),
                redirectURL = protocol + ":/oauth2Callback",
                accessTokenEndpoint = string.Format("realms/{0}/tokens/access/codes", realmName),
                clientId = clientId,
                refreshTokenEndpoint = string.Format("realms/{0}/tokens/refresh", realmName),
                revokeTokenEndpoint = string.Format("realms/%@/tokens/logout", realmName),
                accountId = clientId
            });
        }