public OperationDataResult <EntityGroup> GetEntityGroupExternally(string entityGroupUid, string token, string callerURL)
        {
            // Do some validation of the token. For now token is not valid
            //bool tokenIsValid = false;
            ExchangeIdToken         idToken = new ExchangeIdToken(token);
            IdTokenValidationResult result  = idToken.Validate(callerURL);

            if (result.IsValid)
            {
                try
                {
                    eFormCore.Core core = _coreHelper.GetCore();

                    EntityGroup entityGroup = core.EntityGroupRead(entityGroupUid);

                    return(new OperationDataResult <EntityGroup>(true, entityGroup));
                }
                catch (Exception)
                {
                    return(new OperationDataResult <EntityGroup>(false,
                                                                 LocaleHelper.GetString("ErrorWhileObtainSelectableList")));
                }
            }
            else
            {
                return(new OperationDataResult <EntityGroup>(false,
                                                             LocaleHelper.GetString("ErrorWhileObtainSelectableList")));
            }
        }
Exemplo n.º 2
0
        // POST api/ValidateExchangeToken
        /// <summary>
        /// Validates an Exchange user identity token
        /// </summary>
        /// <param name="token">The Exchange user identity token as obtained via Office.context.mailbox.getUserIdentityTokenAsync</param>
        public IdTokenValidationResult Post([FromBody] string token)
        {
            ExchangeIdToken idToken = new ExchangeIdToken(token);

            var result = idToken.Validate("https://localhost:44359/add-in/TaskPane/TaskPane.html");

            return(result);
        }
        public OperationDataResult <List <SiteName_Dto> > IndexExternally(string token, string callerURL)
        {
            ExchangeIdToken         idToken = new ExchangeIdToken(token);
            IdTokenValidationResult result  = idToken.Validate(callerURL);

            if (result.IsValid)
            {
                Core core         = _coreHelper.GetCore();
                var  siteNamesDto = core.Advanced_SiteItemReadAll(false);

                return(new OperationDataResult <List <SiteName_Dto> >(true, siteNamesDto));
            }
            else
            {
                return(new OperationDataResult <List <SiteName_Dto> > (false,
                                                                       LocaleHelper.GetString("ErrorWhileObtainSiteList")));
            }
        }