title: Microsoft Android application is not matching the signature hash with the application reply URI
body: <p><strong>Goal:</strong> Use the MS Identity application that was created by <a href="https://github.com/Azure-Samples/ms-identity-android-java/" rel="nofollow noreferrer">Microsoft</a> and try to tailor the application according to our needs.</p>
  <p><strong>Issue</strong> The android application is not matching the signature hash with the Applications' Reply URI.</p>
  <h3>Configuration Values</h3>
  <pre><code>Signature Hash: ga0RGNYHvNM5d0SLGQfpQWAPGJ8=
  Redirect URI: msauth://com.azuresamples.msalandroidapp/ga0RGNYHvNM5d0SLGQfpQWAPGJ8%3D
  Android:host: com.azuresamples.msalandroidapp
  Android Scheme: msauth
  </code></pre>
  <h3>Logs and Screenshots</h3>
  <p>Logs show: The redirect URI in the configuration file doesn't match with the one generated with package name and signature hash.
  <a href="https://i.stack.imgur.com/DyGnm.png" rel="nofollow noreferrer">Screenshot of the error in the Android Emulator</a></p>
  <h3>Methods Tried</h3>
  <ol>
  <li><p>Tried to fix this by changing the android:path value to <code>/ga0RGNYHvNM5d0SLGQfpQWAPGJ8%3D</code> however got this message from the UI:
  <a href="https://i.stack.imgur.com/yK4NC.png" rel="nofollow noreferrer">Screenshot of the update android:path value</a></p>
  </li>
  <li><p>Tried to change the Reply URI directly from Azure Portal, but was not able to</p>
  </li>
  <li><p>Tried changing the Redirect URI in the android code to <code>msauth://com.azuresamples.msalandroidapp/ga0RGNYHvNM5d0SLGQfpQWAPGJ8%3D</code> but that gave the same error</p>
  </li>
  <li><p>The default library in the code was 1.2, changed it to 1.5+ in gradle and still it didnt work.</p>
  </li>
  </ol>
  <h3>Configuration Files</h3>
  <p>auth_config_single_account.json</p>
  <pre><code>
    &quot;client_id&quot; : &quot;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&quot;,
    &quot;authorization_user_agent&quot; : &quot;DEFAULT&quot;,
    &quot;redirect_uri&quot; : &quot;msauth://com.azuresamples.msalandroidapp/ga0RGNYHvNM5d0SLGQfpQWAPGJ8%3D&quot;,
    &quot;account_mode&quot; : &quot;SINGLE&quot;,
    &quot;broker_redirect_uri_registered&quot;: true,
    &quot;authorities&quot; : [
      {
        &quot;type&quot;: &quot;AAD&quot;,
        &quot;authority_url&quot;: &quot;https://login.microsoftonline.com/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&quot;
      }
    ]
  }
  </code></pre>
  <p>AndroidManifest.xml</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      package=&quot;com.azuresamples.msalandroidapp&quot;&gt;
      ...
              &lt;intent-filter&gt;
                  ... 
                  &lt;data
                      android:host=&quot;com.azuresamples.msalandroidapp&quot;
                      android:path=&quot;/ga0RGNYHvNM5d0SLGQfpQWAPGJ8=&quot;
                      android:scheme=&quot;msauth&quot; /&gt;
              &lt;/intent-filter&gt;
         ...
  
  &lt;/manifest&gt;
  </code></pre>
  <p>Build-Gradle:app</p>
  <pre><code>...
  dependencies {
      implementation fileTree(dir: 'libs', include: ['*.jar'])
      implementation &quot;androidx.appcompat:appcompat:$rootProject.ext.appCompatVersion&quot;
      implementation &quot;com.google.android.material:material:$rootProject.ext.materialVersion&quot;
      implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
      implementation 'androidx.legacy:legacy-support-v4:1.0.0'
  
      implementation 'com.android.volley:volley:1.1.1'
  
      if (findProject(':msal') != null) {
          // For developer team only.
          localImplementation project(':msal')
          externalImplementation 'com.microsoft.identity.client:msal:1.5.+'
      }
      else {
          // Downloads and Builds MSAL from maven central.
          implementation 'com.microsoft.identity.client:msal:1.5.+'
      }
  
  }
  </code></pre>
  <h2>Update</h2>
  <p>Was trying to avoid this but I have updated my keystore using the debug.keystore that microsoft provides and it works, however this is not solution for production environments. What are the steps I need to take for this to work in the production environment.</p>