Redirect_URI Problem with Sphinx Client Application

I created a Sphinx server as described in the documentation. Have this tested as described via ".. /.well-known/openid-configuration" and I get the JSON message back. Ok, works!.
After that, I did the next step and added the database files as described and registering a client application. If I now start the Sphinx server, the tables are created, the server shows running.

But after insert the URL "...&redirect_uri=http://127.0.0.1" as an answer I don't get the login screen, but the start screen of Windows IIS. I cannot deactivate IIS on my computer because it is used for other programs. What can I do?

I testet a lot of things and now the server send me:

Auth server
An error ocurred.
Server returned the following error:
unauthorized_client: Parameter redirect_uri is invalid: http://127.0.0.1:8010/oauth2redirect

But "http://127.0.0.1" is set as my REDIRECT_URI.
So, why do I get this error message?

Can you please provide the full info?

  1. The full code you used to set the client application (or the properties you have set).
  2. The full URL you are trying to connect to.

Hello Wagner,
I was able to solve the problem.
It was not due to the "TMS Sphinx" but to the Devart SqLite UniConnection I used.
There I had the "LockingMode" on "Exclusive".
After changing to "Normal" mode, the problem with the "redirect_uri" no longer occurred.
The login window will now open correctly.
But I have another problem.
After logging in, I immediately get the message "Id Token is expired".

Where do you get such message? Do you have a screenshot? Again:

  1. The full code you used to set the client application (or the properties you have set).
  2. The full URL you are trying to connect to.
  3. Screenshot/context/more info about the error.

Hello Wagner,
below is the desired information about my Sphinx app:

I used the demo you supplied. Use Devart's SQLLite (SQLiteDac) instead of SQLLite from Embarcadero.
The server application runs on a virtual Internet server.
The data exchange runs over an HTTPS (see attached screenshot TMSHTTPConfig)

SphinxServer1.baseURL = https://+:2003/sphinx

the URL used is marked in blue.

The Connection String from UNIConnection:
Provider Name=SQLite;Direct=True;Force Create Database=True;Use Unicode=True;Integer As LargeInt=True;Locking Mode=Normal;Login Prompt=False

At the Client APP the SphinxLogin1.Authority is set to:
"https://app.taxiplan.info:2003/sphinx"

When I start the client app, the login takes place.
If the user is not registered, I can register the user with his password. It works.
Then I log in with the user in the client app and immediately receive the message "Application authorization failed - Id token is expired" (see attachment)
Login_client

After_login

I hope you can do something with the information and help me further.
Thank you in advance
Andreas

These are the client settings in the Server App:

procedure TForm7.ConfigureClients;
var
Client: TSphinxClientApp;
begin
// The following properties can be simply set at design-time using the TSphinxConfig.Clients property
// We keep it in the code here for learning purposes

// Create desktop client
Client := SphinxConfig1.Clients.Add;
Client.ClientId := 'desktop';
Client.DisplayName := 'Taxiplan Login';
Client.RedirectUris.Add('http://127.0.0.1');
Client.RequireClientSecret := False;
Client.AllowedGrantTypes := [TGrantType.gtAuthorizationCode];
Client.ValidScopes.Add('openid');
Client.ValidScopes.Add('email');
end;

Still no clue. More questions:

  1. Does the original Sphinx demo works fine?
  2. If original Sphinx demo works, can you please send your full modified project so we can debug and trace?
  3. Can you please check your browser network tab and find the request where the identity token is returned? Then also please let me know the exact date/time of your computer at that time.

Thank you.

Hello Wagner,
Mea Culpa.
It was the time setting. On my virtual server, the time was 1 hour back. Thus, a login was of course not possible. The server had the wrong internet time. But I hadn't paid attention to it until your hint to check the time.
Sphinx and Login now work's fine.

The login page is a browser page.
After a successful login, it is displayed that I can close the window and then get the tokens displayed in the memo.
2 questions:
Can I close the browser window automatically after successful login?
How do I get the login window displayed in another language?

1 Like

No, the browser can't be closed automatically after login.
Maybe - maybe - you can do lots of Window messaging workarounds from your app to close the browser window after you received the access token, but that would be a big kludge and I wouldn't recommend it. Remember that the user might have other tabs open in the browser, and who knows which browser he's using.

Regarding the language, yes, it's possible, would you mind asking this in a different topic?