Redirect_uri did not match any client's registered redirect_uris

I've installed the cfgtest application and setup the config-test app in the IAM admin interface, however, I am receiving the above error message from the IAM service when I try to go to cfgtest in my browser. When I open the browser to https://nodevdom04.cryptsharedev.local:8080 it immediately bounces to the IAM site (as expected), but then shows the error.

I've checked that the redirect_uri in the url is in fact correct and matches the app id in the IAM application setup.

I changed the IAM services logging to debug and this is what is being logged:

[08:21:12][info][initServices][worker-1]: IAM service serves on port 7443
[08:21:12][debug][DominoDB][worker-1]: DB.useDocument & document.read for collection [Settings].costTime = 24.99999999999991 ms.
[08:21:12][info][initServices][worker-1]: Admin service serves on port 8443
[08:21:23][debug][DominoDB][worker-1]: commonConfig.ENABLE_QUERY_BY_ID setting is set to false
[08:21:23][debug][base][worker-1]: commonConfig.ENABLE_NO_VIEW_REFRESH setting is set to true
[08:21:23][debug][oidcStorage][worker-1]: Creating oidcStorage instance with name: Client.
[08:21:23][debug][DominoDB][worker-1]: commonConfig.ENABLE_QUERY_BY_ID setting is set to false
[08:21:23][debug][DominoDB][worker-1]: Build query object: { query: '\'Client\'._id = \'472c97a7-923e-4e77-a111-298732b0d3c2\'',
queryFlags: {},
start: 0,
itemNames: [ '*' ],
onErrorOptions: 'ON_ERROR_ABORT_REMAINING',
count: 1 }
[08:21:23][debug][DominoDB][worker-1]: DB.bulkReadDocuments.costTime = 37.00000000000081 ms.
[08:21:23][debug][DominoDB][worker-1]: Find 1 documents in findOne method
[08:21:23][debug][CustomUtils][worker-1]: renderError: {
"error": "redirect_uri_mismatch",
"error_description": "redirect_uri did not match any client's registered redirect_uris",
"state": "5ac042cf91b4f666c25bb5f05cfd2dfa"
}

I checked in the iamstore.nsf to make sure that the app id is also present and correct.

It also returns a document if I use ptest:

C:\domino-db\package>npm run ptest -- read nodevdom04/iamstore.nsf -q "'Client'._id = '472c97a7-923e-4e77-a111-298732b0d3c2'" -p

> @domino/domino-db@1.6.0 ptest C:\domino-db\package
> node proton-test/bin/ptest "read" "nodevdom04/iamstore.nsf" "-q" "'Client'._id = '472c97a7-923e-4e77-a111-298732b0d3c2'" "-p"

{
"documents": [
{
"@unid": "4885C04DFA60A4BCC12585DD003EDE7E",
"@created": {
"type": "datetime",
"data": "2020-09-08T11:26:41.90Z"
},
"@modified": {
"type": "datetime",
"data": "2020-09-08T11:27:29Z"
}
}
],
"errors": 0,
"documentRange": {
"total": 1,
"start": 0,
"count": 1
}
}

My oauthcfg list shows:

C:\domino>oauthcfg list
name:default id:3957c7d4-0b73-4f33-b89c-8a923f5d0901 URI:https://nodevdom04.cryptsharedev.local:7443/token/introspection
name:proton-addin id:d2d690d0-71c2-4857-820c-1e4f2a692b9f URI:https://nodomdev04.cryptsharedev.local:7443/token/introspection

Any help or pointers would be greatly appreciated

Kind Regards
Heidi

I just noticed that the redirect_uri in the url is actually missing the port 8080.

I shall research a little more...

Ok, I temporarily bodged something together in the sample app to add 8080 into the URL. I changed line 35 in IAMClient.js to:

redirect_uri: this.redirect_uri.indexOf(':8080') !== -1 ? this.redirect_uri : this.redirect_uri.replace('/auth', ':8080/auth'),

However, after I login and the browser redirects to the /auth endpoint in the sample app, it throws the following error:

OpenIdConnectError: invalid_grant (grant request is invalid)
at Client.requestErrorHandler (C:\cfgtest\package\node_modules\openid-client\lib\helpers\error_handler.js:16:11)
at process._tickCallback (internal/process/next_tick.js:68:7)

In the Network debugger in the browser I am seeing two requests. The first the redirect to IAM:

https://nodevdom04.cryptsharedev.local:7443/auth?client_id=9d5dbf2a-4cf4-40e8-a288-c8d73529110f&scope=openid&response_type=code&redirect_uri=https%3A%2F%2Fnodevdom04.cryptsharedev.local%3A8080%2Fauth&nonce=23e4aa5c8a0f953676a6614e3043a6b9&state=0f3ba26048ab51d8dd8a16106c0cc0b8

and then the redirect to the sample app:

https://nodevdom04.cryptsharedev.local:8080/auth?code=4kT8Ky2mgXjHQ705mkBZUIZEpgU&state=0f3ba26048ab51d8dd8a16106c0cc0b8

As always any help is greatly appreciated

Kind regards
Heidi

Moved my previous bodge to do the rewriting of the redirect uri to the constructor instead. Now the application shows, although no results... more research :D

I am now getting the following error in the Domino console:

[08D8:0007-0D9C] 09/09/2020 15:26:44 PROTON: NotAuthorized: Attempt by Sample App/cryptsharedev to create Act-as-User, introspection failure
[08D8:0007-0D9C] 09/09/2020 15:26:44 PROTON: Token::lookup: rc=65553 error from introspection
[08D8:0007-0D9C] 09/09/2020 15:26:44 PROTON: ReturnCode = 65553
[08D8:0007-0D9C] 09/09/2020 15:26:44 PROTON: Token::lookup: exit
[08D8:0007-0D9C] 09/09/2020 15:26:44 PROTON: ReturnCode = 65553 (was 0)
[08D8:0007-0D9C] 09/09/2020 15:26:44 PROTON: Session::init_via_behalfof_token2: rc=65553 token.lookup
[08D8:0007-0D9C] 09/09/2020 15:26:44 PROTON: ReturnCode = 65553
[08D8:0007-0D9C] 09/09/2020 15:26:44 PROTON: Session::init_via_behalfof_token2: exit
[08D8:0007-0D9C] 09/09/2020 15:26:44 PROTON: Session::init_via_behalfof_token: rc=65553 Session::init_via_behalfof_token()
[08D8:0007-0D9C] 09/09/2020 15:26:44 PROTON: ReturnCode = 65553
[08D8:0007-0D9C] 09/09/2020 15:26:44 PROTON: Session::init_via_behalfof_token: exit
[08D8:0007-0D9C] 09/09/2020 15:26:44 PROTON: ReturnCode = 65553 (was 0)
[08D8:0007-0D9C] 09/09/2020 15:26:44 PROTON: ReturnCode = 65553
[08D8:0007-0D9C] 09/09/2020 15:26:44 PROTON: ReturnCode = 65553 (was 0)

As per the Troubleshooting page, I've checked that:

The ACL is correct in the iamstore.nsf file and I've ensured that there is a client certificate added into the function ID user

Thanks in advance for any suggestions...
Heidi