This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Configure OAuth2 access token for authorization: Dangl.Identity | |
configuration = avacloud_client_python.Configuration() | |
configuration.access_token = access_token | |
api_instance = avacloud_client_python.GaebConversionApi(avacloud_client_python.ApiClient(configuration)) | |
gaeb_file = './GAEBXML_EN.X86' # File path to the input GAEB file | |
# First, the AVA Project is generated | |
try: | |
# Converts GAEB files to Dangl.AVA projects |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public enum HttpStatusCode | |
{ | |
/* Excerpt from System.Net.HttpStatusCode */ | |
RedirectKeepVerb = 307, | |
TemporaryRedirect = 307 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project Sdk="Microsoft.NET.Sdk.Web"> | |
<PropertyGroup> | |
<TargetFramework>net471</TargetFramework> | |
</PropertyGroup> | |
<ItemGroup> | |
<Content Include="$(PkgXbim_Geometry)\build\x64\Xbim.Geometry.Engine64.dll"> | |
<Link>x64\Xbim.Geometry.Engine64.dll</Link> | |
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services.AddAuthentication() | |
.AddJwtBearer(AuthenticationConstants.JWT_BASE_SCHEME, jwtBearerOptions => | |
{ | |
jwtBearerOptions.Authority = JwtBaseUri; | |
jwtBearerOptions.Audience = RequiredScope; | |
}) | |
.AddJwtBearer(AuthenticationConstants.JWT_FALLBACK_SCHEME, jwtBearerOptions => | |
{ | |
jwtBearerOptions.Authority = JwtFallbackBaseUri; | |
jwtBearerOptions.Audience = RequiredScope; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is the Dangl.Identity OpenID token endpoint | |
const danglIdentityTokenEndpoint = 'https://identity.dangl-it.com/connect/token'; | |
let globalAccessToken; | |
// This function retrieves the JWT Token and stores it in an Html input field and in a global variable | |
async function getAccessToken(clientId, clientSecret, tokenFormFieldId) { | |
// This is an OpenID Client Credentials grant request | |
const clientCredentialsRequest = new Promise(function (resolve, reject) { | |
const requestHeaders = new Headers(); | |
requestHeaders.append('Authorization', 'Basic ' + btoa(clientId + ':' + clientSecret)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (PublishEnvironmentName == "Production") | |
{ | |
var azureCredentials = SdkContext.AzureCredentialsFactory | |
.FromServicePrincipal(AzureServicePrincipalClientId, | |
AzureServicePrincipalClientSecret, | |
AzureServicePrincipalTenantId, | |
AzureEnvironment.AzureGlobalCloud); | |
IAzure azure = Azure.Configure() | |
.WithLogLevel(HttpLoggingDelegatingHandler.Level.Basic) | |
.Authenticate(azureCredentials) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[HttpGet("")] | |
[LightQuery] | |
[Authorize(Policy = DanglIdentityConstants.Authorization.AUTHENTICATION_CONNECTOR_OR_ADMIN_POLICY_NAME)] | |
[NSwag.Annotations.SwaggerResponse((int)HttpStatusCode.OK, typeof(PaginationResult<ClientGet>))] | |
[NSwag.Annotations.SwaggerResponse((int)HttpStatusCode.OK, typeof(IEnumerable<ClientGet>))] | |
public IActionResult GetAllClients(string filter = null) | |
{ | |
var clientsQuery = _identityServerClientsRepository.GetAllClients() | |
.ProjectTo<ClientGet>(); | |
if (!string.IsNullOrWhiteSpace(filter)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// App main entry point | |
(async () => { | |
await getOAuth2AccessToken(); | |
await executeAvaCloudExample(); | |
})(); | |
async function executeAvaCloudExample() { | |
if (!accessToken) { | |
console.log('No access token, exiting app.'); | |
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void executeAvaCloudExample(String[] args) { | |
String clientId = args[0]; | |
String clientSecret = args[1]; | |
String gaebFilePath = args[2]; | |
String bearerToken; | |
try { | |
bearerToken = DanglIdentityUtils.getBearerToken(clientId, clientSecret); | |
} catch (IOException e) { | |
System.out.println("IO Exception while obtaining access token:"); | |
System.out.println(e.toString()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Item ID="ID_cc1077f7-9618-46be-af53-4b500acfefb6" RNoPart="02" RNoIndex="5"> | |
<Qty>240</Qty> | |
<QU>m²</QU> | |
<Description> | |
<OutlineText> | |
<OutlTSA>No</OutlTSA> | |
<OutlTxt> | |
<TextOutlTxt> | |
<span>Wand, 20cm, Stahlbeton</span> | |
</TextOutlTxt> |