Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable SSO connection #1100

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions library/ui-strings/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
<string name="start_video_call">Nouvel appel vidéo</string>
<string name="option_send_files">Envoyer des fichiers</string>
<string name="option_take_photo_video">Prendre une photo ou une vidéo</string>
<string name="auth_login">Je me connecte</string> <!-- Tchap: Custom string -->
<string name="auth_login">Se connecter</string>
<string name="auth_submit">Valider</string>
<string name="auth_invalid_login_param">Nom d’utilisateur et/ou mot de passe incorrect</string>
<string name="auth_forgot_password">Mot de passe oublié \?</string>
Expand Down Expand Up @@ -1054,7 +1054,7 @@
<string name="login_signin_to">S’authentifier sur %1$s</string>
<string name="login_signup">Je m’inscris</string> <!-- Tchap: Custom string -->
<string name="login_signin">Je me connecte</string> <!-- Tchap: Custom string -->
<string name="login_signin_sso">Continuer avec l’authentification unique</string>
<string name="login_signin_sso">Continuer avec AgentConnect</string> <!-- Tchap: Custom string -->
<string name="login_server_url_form_modular_hint">Adresse Element Matrix Services</string>
<string name="login_server_url_form_other_hint">Adresse</string>
<string name="login_server_url_form_modular_text">Hébergement privé pour les organisations</string>
Expand Down
8 changes: 5 additions & 3 deletions library/ui-strings/src/main/res/values-fr/strings_tchap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,11 @@
<string name="tchap_expired_account_on_new_sent_email_title">Nouvel e\u2011mail envoyé</string>

<!-- Login/Register Tchap -->
<string name="tchap_has_account_no">Je n’ai pas\nde compte</string>
<string name="tchap_has_account_yes">J’ai un compte</string>
<string name="tchap_connection_email">Adresse email</string>
<string name="tchap_has_account_yes">Se connecter par mot de passe</string>
<string name="tchap_start_message">La messagerie instantanée du secteur public</string>
<string name="tchap_connection_ac">S’identifier avec \nAgentConnect</string>
<string name="tchap_connection_ac_help">➜ Qu’est-ce que AgentConnect ?</string>
<string name="tchap_connection_email">Adresse mail professionnelle</string>
<string name="tchap_connection_email_help">Utilisez votre adresse professionnelle</string>
<string name="tchap_connection_password_help">Votre mot de passe doit contenir au moins 8 caractères, avec au moins un caractère de chaque type : majuscule, minuscule, chiffre, caractère spécial.</string>
<string name="tchap_connection_password_confirm">Confirmer le mot de passe</string>
Expand Down
8 changes: 5 additions & 3 deletions library/ui-strings/src/main/res/values/strings_tchap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,11 @@
<string name="tchap_expired_account_on_new_sent_email_title">Email sent</string>

<!-- Login/Register Tchap -->
<string name="tchap_has_account_no">I do not have\nan account</string>
<string name="tchap_has_account_yes">I already have\nan account</string>
<string name="tchap_connection_email">Email</string>
<string name="tchap_has_account_yes">Login by password</string>
<string name="tchap_start_message">Instant messaging of public sector</string>
<string name="tchap_connection_ac">Authenticate with \nAgentConnect</string>
<string name="tchap_connection_ac_help">➜ What is AgentConnect ?</string>
<string name="tchap_connection_email">Professional email</string>
<string name="tchap_connection_email_help">Use your business address</string>
<string name="tchap_connection_password_help">Your password must include a lower-case letter, an upper-case letter, a number and a symbol and be at a minimum 8 characters in length.</string>
<string name="tchap_connection_password_confirm">Password confirmation</string>
Expand Down
10 changes: 10 additions & 0 deletions library/ui-styles/src/main/res/drawable/ic_tchap_agentconnect.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="40dp"
android:height="43dp"
android:viewportWidth="62"
android:viewportHeight="67">
<path
android:pathData="M34.912,2.748C32.639,1.459 29.845,1.459 27.567,2.748C20.406,6.806 13.244,10.887 6.106,14.991C3.838,16.29 2.438,18.679 2.433,21.267C2.41,29.423 2.41,37.591 2.433,45.747C2.438,48.335 3.838,50.729 6.106,52.029C13.244,56.127 20.406,60.208 27.567,64.266C29.845,65.555 32.639,65.555 34.912,64.266C42.073,60.208 49.235,56.127 56.373,52.029C58.641,50.729 60.041,48.335 60.046,45.747C60.069,37.591 60.069,29.423 60.046,21.267C60.041,18.679 58.641,16.29 56.373,14.991C49.235,10.887 42.073,6.806 34.912,2.748ZM9.376,23.879C9.363,28.429 9.359,32.978 9.363,37.528C9.955,37.537 10.539,37.608 11.134,37.68C11.334,37.704 11.535,37.728 11.739,37.75C12.547,37.811 13.298,37.984 14.093,38.166C14.172,38.184 14.251,38.202 14.331,38.221C14.52,38.221 14.626,38.385 14.729,38.544C14.812,38.673 14.893,38.799 15.015,38.829C15.178,38.883 15.342,38.894 15.506,38.904C15.752,38.92 15.998,38.936 16.243,39.098C16.243,39.053 16.236,39.008 16.228,38.963C16.213,38.874 16.198,38.784 16.243,38.695C16.397,38.541 16.572,38.582 16.746,38.623C16.879,38.655 17.011,38.686 17.131,38.628C17.5,38.397 17.149,38.046 16.8,37.696C16.633,37.529 16.467,37.362 16.379,37.209C16.379,37.142 16.447,37.075 16.447,37.075C16.607,37.214 16.755,37.358 16.901,37.501C17.256,37.846 17.602,38.185 18.083,38.422C18.427,38.556 19.243,38.762 19.108,38.355C18.869,37.837 18.462,37.383 18.052,36.926C17.877,36.732 17.702,36.537 17.539,36.336V36.063C17.44,36.063 17.413,36.027 17.379,35.981C17.367,35.965 17.354,35.947 17.335,35.929V35.66C17.166,35.576 17.128,35.44 17.09,35.3C17.067,35.217 17.044,35.132 16.991,35.056C16.878,34.867 16.869,34.637 16.861,34.401C16.854,34.213 16.847,34.021 16.787,33.843C16.651,33.436 16.583,33.1 16.515,32.697C16.434,32.241 16.342,31.807 16.252,31.381C16.116,30.736 15.983,30.111 15.899,29.461C15.797,28.473 16.3,27.646 16.818,26.793C16.972,26.54 17.126,26.285 17.267,26.024C17.743,25.213 18.287,24.408 19.176,23.866C19.379,23.062 19.926,22.387 20.469,21.717L20.472,21.713C21.011,21.06 21.909,20.662 22.563,20.373L22.58,20.366C23.128,20.122 23.65,19.929 23.99,19.812H23.986C23.986,19.812 27.688,18.515 30.973,18.515C34.262,18.519 37.606,19.426 38.176,19.74C38.18,19.74 38.189,19.744 38.193,19.749C38.232,19.768 38.278,19.792 38.334,19.821C38.351,19.83 38.369,19.84 38.388,19.85C38.644,19.986 38.961,20.153 39.208,20.283C39.265,20.313 39.318,20.341 39.366,20.366C39.867,20.622 40.356,20.945 40.671,21.444C40.806,21.646 41.01,22.049 40.874,22.317C40.841,22.4 40.812,22.494 40.782,22.592C40.689,22.895 40.587,23.227 40.326,23.329C39.918,23.531 39.374,23.53 38.894,23.463C38.622,23.463 38.35,23.396 38.078,23.329C39.098,23.732 40.054,24.206 40.738,25.146C40.806,25.285 41.078,25.352 41.35,25.352C41.418,25.352 41.418,25.486 41.418,25.553C41.395,25.577 41.371,25.598 41.348,25.618C41.241,25.715 41.158,25.79 41.214,25.956H41.418C41.557,25.902 41.627,25.757 41.695,25.619C41.794,25.418 41.886,25.23 42.171,25.352C42.511,25.553 42.646,26.024 42.443,26.364C42.171,26.632 41.898,26.834 41.622,27.035C41.554,27.17 41.554,27.371 41.622,27.505C41.831,27.778 41.898,28.047 41.962,28.315C42.068,28.553 42.137,28.81 42.207,29.066C42.274,29.316 42.342,29.565 42.443,29.797C42.715,30.808 42.986,31.82 42.918,32.831C42.918,33.029 42.882,33.218 42.845,33.405C42.783,33.726 42.722,34.041 42.85,34.38C42.949,34.768 43.155,35.088 43.365,35.412C43.445,35.538 43.527,35.664 43.603,35.795C43.707,35.951 43.811,36.086 43.911,36.217C44.073,36.427 44.225,36.625 44.35,36.873C44.442,37.023 44.55,37.173 44.659,37.324C45.041,37.854 45.435,38.4 45.171,39.03C45.043,39.324 44.702,39.408 44.348,39.495C44.135,39.548 43.917,39.601 43.739,39.702C43.339,40.035 43.657,40.557 43.862,40.894C43.866,40.901 43.87,40.908 43.875,40.915C44.215,41.524 43.467,41.926 42.986,42.128C43.062,42.239 43.177,42.27 43.277,42.296C43.361,42.318 43.435,42.337 43.467,42.401C43.491,42.522 43.551,42.625 43.608,42.724C43.709,42.899 43.801,43.059 43.671,43.274C43.584,43.403 43.442,43.512 43.302,43.619C43.001,43.85 42.708,44.075 42.986,44.487C43.261,44.958 43.086,45.475 42.921,45.964L42.918,45.973C42.714,46.577 42.171,46.846 41.69,46.98C41.282,47.118 40.806,47.118 40.394,47.047C40.258,46.98 40.122,46.913 39.986,46.913C39.551,46.862 39.116,46.784 38.681,46.705C37.956,46.574 37.231,46.443 36.506,46.443C36.166,46.51 35.826,46.577 35.549,46.711C35.243,46.934 34.967,47.177 34.725,47.433L34.717,47.442C34.666,47.496 34.614,47.551 34.568,47.605C34.538,47.639 34.508,47.672 34.483,47.71C34.462,47.731 34.44,47.757 34.423,47.778C34.224,48.025 34.045,48.285 33.884,48.554C33.875,48.571 33.867,48.587 33.854,48.604C33.837,48.638 33.82,48.667 33.803,48.701C33.578,49.112 33.408,49.528 33.284,49.935C32.821,51.479 33.025,52.806 33.352,53.125C33.388,53.159 33.743,53.283 34.253,53.46C35.041,53.734 36.196,54.135 37.109,54.535C37.151,54.554 37.192,54.572 37.233,54.591C37.389,54.661 37.535,54.727 37.67,54.791C41.992,52.335 46.31,49.868 50.619,47.395C52.153,46.514 53.101,44.894 53.105,43.14C53.126,36.722 53.126,30.296 53.105,23.879C53.101,22.125 52.153,20.504 50.619,19.623C45.001,16.399 39.366,13.189 33.726,9.995C32.188,9.122 30.293,9.122 28.754,9.995C23.115,13.189 17.484,16.399 11.866,19.623C10.328,20.504 9.38,22.125 9.376,23.879ZM17.367,50.548C17.756,50.77 18.145,50.992 18.534,51.215L18.615,51.135C19.001,50.753 19.396,50.342 19.783,49.926H19.775C20.501,49.12 21.211,48.344 22.053,47.635C22.308,47.408 22.554,47.211 22.792,47.047C22.826,47.014 22.843,46.963 22.86,46.913C22.877,46.862 22.894,46.812 22.928,46.778C22.757,46.846 22.62,46.948 22.482,47.05C22.348,47.151 22.212,47.251 22.044,47.32C21.972,47.32 21.908,47.253 21.972,47.181C22.213,47.009 22.45,46.833 22.686,46.656L22.703,46.644H22.656C22.588,46.644 22.588,46.577 22.588,46.51C21.706,46.377 21.03,46.971 20.418,47.509L20.404,47.521C20.313,47.566 20.222,47.521 20.152,47.487C20.117,47.469 20.086,47.454 20.064,47.454C19.526,47.631 19.063,47.956 18.597,48.284C18.176,48.581 17.752,48.879 17.267,49.07V48.936C17.095,48.992 16.926,49.067 16.756,49.142C16.52,49.247 16.284,49.352 16.039,49.406C15.852,49.448 15.678,49.469 15.504,49.481C16.124,49.838 16.745,50.193 17.367,50.548ZM13.164,48.142C13.434,48.297 13.704,48.452 13.974,48.608C14.794,48.197 15.738,47.769 16.651,47.454C16.753,47.387 16.856,47.319 16.959,47.251C17.062,47.182 17.165,47.114 17.267,47.047C17.442,46.978 17.599,46.856 17.765,46.726C17.923,46.603 18.089,46.473 18.287,46.376C18.836,45.973 19.243,45.498 19.447,44.827C19.447,44.759 19.379,44.692 19.379,44.692C18.496,45.633 17.471,46.375 16.379,46.913C15.348,47.449 14.242,47.527 13.144,47.605C12.876,47.624 12.608,47.643 12.342,47.668C12.616,47.827 12.89,47.984 13.164,48.142ZM12.032,47.492C12.087,47.524 12.142,47.557 12.198,47.588H12.219C12.219,47.431 12.302,47.355 12.403,47.264C12.432,47.238 12.461,47.212 12.491,47.181H12.695C12.729,47.181 12.746,47.148 12.763,47.114C12.78,47.081 12.797,47.047 12.831,47.047C12.967,47.047 13.171,46.98 13.103,46.98C12.999,46.844 12.843,46.898 12.67,46.958C12.502,47.016 12.318,47.079 12.151,46.98C12.216,46.915 12.234,46.834 12.251,46.761C12.269,46.682 12.284,46.612 12.355,46.577H12.627C12.627,46.443 12.763,46.308 12.763,46.308C13.372,45.946 13.958,45.633 14.533,45.325C14.924,45.116 15.31,44.91 15.695,44.692C15.616,44.692 15.547,44.723 15.481,44.752C15.375,44.798 15.276,44.842 15.151,44.76C15.219,44.76 15.219,44.708 15.219,44.657C15.219,44.605 15.219,44.554 15.287,44.554C15.717,44.439 16.101,44.258 16.492,44.074C16.785,43.936 17.081,43.796 17.403,43.681C17.31,43.681 17.225,43.704 17.141,43.728C16.981,43.772 16.83,43.813 16.651,43.681C16.696,43.659 16.734,43.629 16.771,43.6C16.847,43.54 16.924,43.479 17.063,43.479V43.274C17.063,43.207 17.131,43.207 17.199,43.207C17.131,43.207 17.063,43.14 17.063,43.14C17.098,43.07 17.17,43.055 17.25,43.037C17.324,43.021 17.406,43.003 17.471,42.938H17.471C17.403,42.938 17.267,42.938 17.267,42.871C17.471,42.602 17.811,42.535 18.151,42.468C18.117,42.401 18.049,42.401 17.99,42.401C17.93,42.401 17.879,42.401 17.879,42.334C17.879,42.262 17.947,42.262 18.015,42.262H17.879C17.774,42.21 17.791,42.118 17.804,42.048C17.808,42.027 17.811,42.009 17.811,41.994C18.081,41.682 18.173,41.311 18.264,40.939C18.31,40.749 18.357,40.56 18.427,40.378C18.36,40.378 18.287,40.378 18.287,40.311C17.628,41.032 16.58,41.306 15.583,41.567C15.552,41.575 15.521,41.583 15.491,41.591H15.151C14.811,41.725 14.331,41.725 13.991,41.524C13.826,41.442 13.711,41.336 13.585,41.22C13.503,41.144 13.416,41.063 13.307,40.982C12.763,40.646 12.219,40.378 11.602,40.176C10.867,39.945 10.124,39.761 9.367,39.635C9.369,40.218 9.37,40.803 9.372,41.388C9.373,41.972 9.374,42.556 9.376,43.14C9.38,44.894 10.328,46.514 11.866,47.395C11.921,47.427 11.976,47.459 12.032,47.492ZM9.367,38.33V38.573C10.302,38.292 11.212,38.032 12.219,38.086C12.08,38.041 11.908,38.057 11.749,38.072C11.673,38.079 11.6,38.086 11.535,38.086C10.821,38.036 10.107,38.174 9.367,38.33ZM39.663,33.295C39.915,33.273 40.157,33.252 40.424,33.318C40.508,33.339 40.605,33.353 40.699,33.367C40.909,33.398 41.104,33.427 41.104,33.52C41.028,33.821 40.739,33.997 40.428,34.186C40.181,34.336 39.92,34.495 39.74,34.733H39.536C39.44,34.796 39.404,34.904 39.372,35.001C39.336,35.111 39.304,35.207 39.196,35.207C38.988,35.14 38.784,35.207 38.58,35.274L38.579,35.274C38.851,35.543 39.196,35.744 39.604,35.677C39.672,35.677 39.808,35.811 39.808,35.946C39.808,35.946 39.876,35.945 39.944,35.878C40.012,35.878 40.084,35.878 40.084,35.946V36.214C39.944,36.397 39.746,36.397 39.549,36.397C39.451,36.397 39.354,36.398 39.264,36.42C39.808,36.554 40.356,36.554 40.832,36.42C41.053,36.345 41.034,36.113 41.014,35.863C40.997,35.652 40.979,35.428 41.104,35.274C41.036,35.274 41.036,35.224 41.036,35.173C41.036,35.123 41.036,35.073 40.968,35.073C41.011,35.028 41.055,34.978 41.098,34.927C41.191,34.819 41.283,34.711 41.376,34.665C41.516,34.665 41.72,34.598 41.788,34.464C41.788,34.403 41.731,34.355 41.676,34.309C41.611,34.255 41.547,34.201 41.584,34.128C41.992,33.86 42.332,33.452 42.196,33.05C42.153,32.923 41.921,32.876 41.669,32.825C41.522,32.795 41.367,32.763 41.24,32.714C40.972,32.605 40.663,32.667 40.344,32.732C40.258,32.749 40.171,32.767 40.084,32.781C39.877,32.781 39.671,32.854 39.466,32.927C39.331,32.975 39.195,33.023 39.06,33.05C38.58,33.184 38.172,33.452 37.764,33.721C38.108,33.575 38.452,33.5 38.824,33.418C38.966,33.387 39.112,33.355 39.264,33.318C39.402,33.318 39.534,33.306 39.663,33.295Z"
android:fillColor="#ffffff"
android:fillType="evenOdd"/>
</vector>
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,15 @@ fun RegistrationFlowResponse.toFlowResult(): FlowResult {

fun RegistrationFlowResponse.nextUncompletedStage(flowIndex: Int = 0): String? {
val completed = completedStages ?: emptyList()
return flows?.getOrNull(flowIndex)?.stages?.firstOrNull { completed.contains(it).not() }
val flows = flows ?: return null

// TCHAP return LoginFlowTypes.SSO if SSO type is supported by UIA.
if (flowIndex == 0) {
flows.forEach {
if (!it.stages.isNullOrEmpty() && LoginFlowTypes.SSO !in completed && LoginFlowTypes.SSO in it.stages) {
return LoginFlowTypes.SSO
}
}
}
return flows.getOrNull(flowIndex)?.stages?.firstOrNull { it !in completed }
}
24 changes: 12 additions & 12 deletions vector/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />

<!-- To be able to install APK from the application -->
<!-- Tchap: Remove the ability to install an app from Tchap (https://github.com/tchapgouv/tchap-android/issues/832)-->
<!-- TCHAP Remove the ability to install an app from Tchap (https://github.com/tchapgouv/tchap-android/issues/832)-->
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" tools:node="remove" />

<!-- Location Sharing -->
Expand All @@ -57,7 +57,7 @@
<!-- Jitsi SDK is now API23+ -->
<uses-sdk tools:overrideLibrary="com.swmansion.gesturehandler,org.jitsi.meet.sdk,com.oney.WebRTCModule,com.learnium.RNDeviceInfo,com.reactnativecommunity.asyncstorage,com.ocetnik.timer,com.calendarevents,com.reactnativecommunity.netinfo,com.kevinresol.react_native_default_preference,com.rnimmersive,com.corbt.keepawake,com.BV.LinearGradient,com.horcrux.svg,com.oblador.performance,com.reactnativecommunity.slider,com.brentvatne.react,com.reactnativecommunity.clipboard,com.swmansion.gesturehandler.react,org.linusu,org.reactnative.maskedview,com.reactnativepagerview,com.swmansion.reanimated,com.th3rdwave.safeareacontext,com.swmansion.rnscreens,org.devio.rn.splashscreen,com.reactnativecommunity.webview,org.wonday.orientation" />

<!-- Tchap: Jitsi libs adds CALENDAR permissions, but we can remove them safely
<!-- TCHAP Jitsi libs adds CALENDAR permissions, but we can remove them safely
according to https://github.com/jitsi/jitsi-meet/issues/4068#issuecomment-480482481 -->
<uses-permission android:name="android.permission.READ_CALENDAR" tools:node="remove" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" tools:node="remove" />
Expand Down Expand Up @@ -99,7 +99,7 @@
android:name="android.max_aspect"
android:value="9.9" />

<!-- Tchap: Temporary disable android auto (https://github.com/tchapgouv/tchap-android/issues/703) -->
<!-- TCHAP Temporary disable android auto (https://github.com/tchapgouv/tchap-android/issues/703) -->
<!-- <meta-data-->
<!-- android:name="com.google.android.gms.car.application"-->
<!-- android:resource="@xml/automotive_app_desc" />-->
Expand All @@ -117,16 +117,16 @@
android:theme="@style/Theme.Vector.Black.Transparent">

<!-- Add intent filter to handle redirection URL after SSO login in external browser -->
<!-- <intent-filter>-->
<!-- <action android:name="android.intent.action.VIEW" />-->
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<!-- <category android:name="android.intent.category.DEFAULT" />-->
<!-- <category android:name="android.intent.category.BROWSABLE" />-->
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<!-- <data-->
<!-- android:host="connect"-->
<!-- android:scheme="element" />-->
<!-- </intent-filter>-->
<data
android:host="connect"
android:scheme="tchap" />
</intent-filter>
</activity>

<activity
Expand Down Expand Up @@ -396,7 +396,7 @@
android:exported="false"
android:foregroundServiceType="dataSync" />

<!-- Tchap: this service has been moved to withvoip flavor -->
<!-- TCHAP this service has been moved to withvoip flavor -->
<!-- <service-->
<!-- android:name=".features.call.webrtc.ScreenCaptureAndroidService"-->
<!-- android:exported="false"-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ class HomeActivityViewModel @AssistedInject constructor(
Timber.v("DidAskUserConsent: $didAskUser")
if (!didAskUser) {
// TCHAP user already consented about analytics in the private policy
//_viewEvents.post(HomeActivityViewEvents.ShowAnalyticsOptIn)
// _viewEvents.post(HomeActivityViewEvents.ShowAnalyticsOptIn)
_viewEvents.post(HomeActivityViewEvents.SetAnalyticsOptIn)
} else {
_viewEvents.post(HomeActivityViewEvents.ShowNotificationDialog)
Expand Down
Loading
Loading