File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
eFormAPI/eFormAPI/Controllers Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 88using eFormApi . BasePn . Infrastructure ;
99using eFormApi . BasePn . Infrastructure . Helpers ;
1010using eFormApi . BasePn . Infrastructure . Models . API ;
11+ using System . Web . Http . Cors ;
12+ using eFormAPI . Web . Infrastructure . Helpers . ExchangeTokenValidation ;
1113
1214namespace eFormAPI . Web . Controllers
1315{
@@ -25,6 +27,28 @@ public OperationDataResult<List<SiteName_Dto>> Index()
2527 return new OperationDataResult < List < SiteName_Dto > > ( true , siteNamesDto ) ;
2628 }
2729
30+ [ HttpGet ]
31+ [ AllowAnonymous ]
32+ [ Route ( "api/sites/index/exchange/" ) ]
33+ [ EnableCors ( origins : "*" , headers : "content-type" , methods : "GET" ) ]
34+ public OperationDataResult < List < SiteName_Dto > > IndexExternally ( string token , string callerURL )
35+ {
36+ ExchangeIdToken idToken = new ExchangeIdToken ( token ) ;
37+ IdTokenValidationResult result = idToken . Validate ( callerURL ) ;
38+ if ( result . IsValid )
39+ {
40+ Core core = _coreHelper . GetCore ( ) ;
41+ var siteNamesDto = core . Advanced_SiteItemReadAll ( false ) ;
42+
43+ return new OperationDataResult < List < SiteName_Dto > > ( true , siteNamesDto ) ;
44+ }
45+ else
46+ {
47+ return new OperationDataResult < List < SiteName_Dto > > ( false ,
48+ LocaleHelper . GetString ( "ErrorWhileObtainSiteList" ) ) ;
49+ }
50+ }
51+
2852 [ HttpGet ]
2953 public OperationDataResult < SiteName_Dto > Edit ( int id )
3054 {
You can’t perform that action at this time.
0 commit comments