Compare commits

...

7 commits

Author SHA1 Message Date
99800ab3a7
#0000 - Modify OAuth discovery to hard-coded configuration
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Replaced the dynamic useAutoDiscovery function with a hard-coded configuration object. This change ensures more control over OAuth parameters and might address any dynamic discovery issues encountered before.
2024-10-21 10:53:59 +02:00
54f17cc4f2
#0000 - Reorganize and enhance the NGINX configuration structure
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Introduce a refined NGINX configuration template with user, worker settings, and modular include directives. This improves clarity and allows easier integration of additional configuration files, while maintaining existing CORS settings.
2024-10-21 10:25:13 +02:00
7d017d7feb
#0000 - Reorganize and enhance the NGINX configuration structure
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Introduce a refined NGINX configuration template with user, worker settings, and modular include directives. This improves clarity and allows easier integration of additional configuration files, while maintaining existing CORS settings.
2024-10-21 10:18:32 +02:00
d15bf1c7d3
#0000 - Reorganize and enhance the NGINX configuration structure
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Introduce a refined NGINX configuration template with user, worker settings, and modular include directives. This improves clarity and allows easier integration of additional configuration files, while maintaining existing CORS settings.
2024-10-21 10:06:40 +02:00
6e94306755
#0000 - Add Nginx setup to Dockerfile with CORS support
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit introduces the Nginx setup by using the official Nginx Alpine image and copying the custom Nginx configuration into the Docker container. It also includes CORS headers in the Nginx configuration to allow requests from any origin with specific headers and methods.
2024-10-21 09:58:34 +02:00
6352d7f8a0
#0000 - Update redirect URI and client ID for authentication
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Changed the redirect URI and client ID to align with the new POC setup. This update ensures compatibility with the new authentication server configuration.
2024-10-17 12:52:33 +02:00
96d4db86ca
#0000 - Update OAuth discovery URL in app/index.tsx
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Changed the OAuth discovery URL to point to the integration environment. This ensures the authentication flow interacts with the intended backend during development and testing.
2024-10-17 12:50:33 +02:00
3 changed files with 89 additions and 3 deletions

View file

@ -1,3 +1,14 @@
# Use the official Nginx image from Docker Hub
FROM nginx:alpine3.20 FROM nginx:alpine3.20
# Copy your application files to the appropriate directory if needed
COPY dist /usr/share/nginx/html COPY dist /usr/share/nginx/html
# Copy custom Nginx configuration file to the container
COPY nginx-extra.conf /etc/nginx/conf.d/nginx-extra.conf
# Expose the port that the application is running on
EXPOSE 80
# Start Nginx when the container launches
CMD ["nginx", "-g", "daemon off;"]

View file

@ -6,16 +6,70 @@ import {Button, Text, View} from "react-native";
WebBrowser.maybeCompleteAuthSession(); WebBrowser.maybeCompleteAuthSession();
// const redirectURI = AuthSession.makeRedirectUri({native: 'http://127.0.0.1:8082/ssoCallback', // TODO: why is it translated to localhost? Why /ssoCallback is missing?}); // const redirectURI = AuthSession.makeRedirectUri({native: 'http://127.0.0.1:8082/ssoCallback', // TODO: why is it translated to localhost? Why /ssoCallback is missing?});
const redirectURI = 'https://poc-sso-marn.van-hemmen.com/ssoCallback'; const redirectURI = 'https://poc-sso-marn-500.van-hemmen.com/ssoCallback';
console.log(redirectURI); console.log(redirectURI);
export default function indexScreen() { export default function indexScreen() {
const [tokenResponse, setTokenResponse] = useState<TokenResponse | null>(null); const [tokenResponse, setTokenResponse] = useState<TokenResponse | null>(null);
const clientId = '509-marn-app'; const clientId = '509-marn-poc-app';
const discovery = AuthSession.useAutoDiscovery('https://fes509-ref.m-team.be/login/oauth2/realms/root/realms/509'); // const discovery = AuthSession.useAutoDiscovery('https://auth-integ.partenamut.be/login/oauth2');
const discovery = {
"request_parameter_supported": true,
"pushed_authorization_request_endpoint": "https://auth-integ.partenamut.be/login/oauth2/par",
"introspection_encryption_alg_values_supported": ["ECDH-ES+A256KW", "ECDH-ES+A192KW", "RSA-OAEP", "ECDH-ES+A128KW", "RSA-OAEP-256", "A128KW", "A256KW", "ECDH-ES", "dir", "A192KW"],
"claims_parameter_supported": false,
"introspection_endpoint": "https://auth-integ.partenamut.be/login/oauth2/introspect",
"issuer": "https://auth-integ.partenamut.be/login/oauth2",
"id_token_encryption_enc_values_supported": ["A256GCM", "A192GCM", "A128GCM", "A128CBC-HS256", "A192CBC-HS384", "A256CBC-HS512"],
"userinfo_encryption_enc_values_supported": ["A256GCM", "A192GCM", "A128GCM", "A128CBC-HS256", "A192CBC-HS384", "A256CBC-HS512"],
"authorization_endpoint": "https://auth-integ.partenamut.be/login/oauth2/authorize",
"authorization_encryption_alg_values_supported": ["ECDH-ES+A256KW", "ECDH-ES+A192KW", "RSA-OAEP", "ECDH-ES+A128KW", "RSA-OAEP-256", "A128KW", "A256KW", "ECDH-ES", "dir", "A192KW"],
"introspection_encryption_enc_values_supported": ["A256GCM", "A192GCM", "A128GCM", "A128CBC-HS256", "A192CBC-HS384", "A256CBC-HS512"],
"claims_supported": [],
"rcs_request_signing_alg_values_supported": ["PS384", "ES384", "RS384", "HS256", "HS512", "ES256", "RS256", "HS384", "ES512", "PS256", "PS512", "RS512"],
"token_endpoint_auth_methods_supported": ["client_secret_post", "private_key_jwt", "self_signed_tls_client_auth", "tls_client_auth", "none", "client_secret_basic"],
"tls_client_certificate_bound_access_tokens": true,
"response_modes_supported": ["query.jwt", "fragment", "jwt", "form_post.jwt", "form_post", "fragment.jwt", "query"],
"backchannel_logout_session_supported": true,
"token_endpoint": "https://auth-integ.partenamut.be/login/oauth2/access_token",
"response_types_supported": ["code token id_token", "code", "code id_token", "id_token", "code token", "token", "token id_token"],
"authorization_encryption_enc_values_supported": ["A256GCM", "A192GCM", "A128GCM", "A128CBC-HS256", "A192CBC-HS384", "A256CBC-HS512"],
"revocation_endpoint_auth_methods_supported": ["client_secret_post", "private_key_jwt", "self_signed_tls_client_auth", "tls_client_auth", "none", "client_secret_basic"],
"request_uri_parameter_supported": true,
"grant_types_supported": ["implicit", "urn:ietf:params:oauth:grant-type:saml2-bearer", "refresh_token", "password", "client_credentials", "urn:ietf:params:oauth:grant-type:device_code", "authorization_code", "urn:openid:params:grant-type:ciba", "urn:ietf:params:oauth:grant-type:uma-ticket", "urn:ietf:params:oauth:grant-type:token-exchange", "urn:ietf:params:oauth:grant-type:jwt-bearer"],
"version": "3.0",
"userinfo_endpoint": "https://auth-integ.partenamut.be/login/oauth2/userinfo",
"require_request_uri_registration": true,
"code_challenge_methods_supported": ["plain", "S256"],
"id_token_encryption_alg_values_supported": ["ECDH-ES+A256KW", "ECDH-ES+A192KW", "RSA-OAEP", "ECDH-ES+A128KW", "RSA-OAEP-256", "A128KW", "A256KW", "ECDH-ES", "dir", "A192KW"],
"authorization_signing_alg_values_supported": ["PS384", "RS384", "EdDSA", "ES384", "HS256", "HS512", "ES256", "RS256", "HS384", "ES512", "PS256", "PS512", "RS512"],
"request_object_signing_alg_values_supported": ["PS384", "ES384", "RS384", "HS256", "HS512", "ES256", "RS256", "HS384", "ES512", "PS256", "PS512", "RS512"],
"request_object_encryption_alg_values_supported": ["ECDH-ES+A256KW", "ECDH-ES+A192KW", "ECDH-ES+A128KW", "RSA-OAEP", "RSA-OAEP-256", "A128KW", "A256KW", "ECDH-ES", "dir", "A192KW"],
"rcs_response_signing_alg_values_supported": ["PS384", "ES384", "RS384", "HS256", "HS512", "ES256", "RS256", "HS384", "ES512", "PS256", "PS512", "RS512"],
"introspection_signing_alg_values_supported": ["PS384", "RS384", "EdDSA", "ES384", "HS256", "HS512", "ES256", "RS256", "HS384", "ES512", "PS256", "PS512", "RS512"],
"check_session_iframe": "https://auth-integ.partenamut.be/login/oauth2/connect/checkSession",
"scopes_supported": [],
"backchannel_logout_supported": true,
"acr_values_supported": ["itsmeAffiliation", "eid", "impersonate", "impersonateNew", "usernamePassword", "fasCitizenLevel400", "itsme"],
"request_object_encryption_enc_values_supported": ["A256GCM", "A192GCM", "A128GCM", "A128CBC-HS256", "A192CBC-HS384", "A256CBC-HS512"],
"rcs_request_encryption_alg_values_supported": ["ECDH-ES+A256KW", "ECDH-ES+A192KW", "RSA-OAEP", "ECDH-ES+A128KW", "RSA-OAEP-256", "A128KW", "A256KW", "ECDH-ES", "dir", "A192KW"],
"userinfo_signing_alg_values_supported": ["ES384", "HS256", "HS512", "ES256", "RS256", "HS384", "ES512"],
"require_pushed_authorization_requests": false,
"rcs_response_encryption_enc_values_supported": ["A256GCM", "A192GCM", "A128GCM", "A128CBC-HS256", "A192CBC-HS384", "A256CBC-HS512"],
"userinfo_encryption_alg_values_supported": ["ECDH-ES+A256KW", "ECDH-ES+A192KW", "RSA-OAEP", "ECDH-ES+A128KW", "RSA-OAEP-256", "A128KW", "A256KW", "ECDH-ES", "dir", "A192KW"],
"end_session_endpoint": "https://auth-integ.partenamut.be/login/oauth2/connect/endSession",
"rcs_request_encryption_enc_values_supported": ["A256GCM", "A192GCM", "A128GCM", "A128CBC-HS256", "A192CBC-HS384", "A256CBC-HS512"],
"revocation_endpoint": "https://auth-integ.partenamut.be/login/oauth2/token/revoke",
"rcs_response_encryption_alg_values_supported": ["ECDH-ES+A256KW", "ECDH-ES+A192KW", "ECDH-ES+A128KW", "RSA-OAEP", "RSA-OAEP-256", "A128KW", "A256KW", "ECDH-ES", "dir", "A192KW"],
"token_endpoint_auth_signing_alg_values_supported": ["PS384", "ES384", "RS384", "HS256", "HS512", "ES256", "RS256", "HS384", "ES512", "PS256", "PS512", "RS512"],
"jwks_uri": "https://auth-integ.partenamut.be/login/oauth2/connect/jwk_uri",
"subject_types_supported": ["public", "pairwise"],
"id_token_signing_alg_values_supported": ["PS384", "ES384", "RS384", "HS256", "HS512", "ES256", "RS256", "HS384", "ES512", "PS256", "PS512", "RS512"],
"registration_endpoint": "https://auth-integ.partenamut.be/login/oauth2/register"
}
const [request, result, promptAsync] = AuthSession.useAuthRequest( const [request, result, promptAsync] = AuthSession.useAuthRequest(
{ {

21
nginx-extra.conf Normal file
View file

@ -0,0 +1,21 @@
server {
listen 80;
location / {
# other settings...
# Allow CORS for all domains (or specify a particular domain instead of *)
add_header 'Access-Control-Allow-Origin' '*';
# Allow specific headers
add_header 'Access-Control-Allow-Headers' 'Origin, X-Requested-With, Content-Type, Accept, Authorization';
# Allow specific methods
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS';
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Headers' 'Origin, X-Requested-With, Content-Type, Accept, Authorization';
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS';
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain; charset=utf-8';
add_header 'Content-Length' 0;
return 204;
}
}
}