Missing required parameter: AuthorizationEndpoint - TSphinxWebLogin

Hello,

I am trying to use TMS Sphinx to authenticate a web application and I am not bale to get past “Missing required parameter: AuthorizationEndpoint”.

I have an authentication server that works just fine when I try with a regular VCL app but fails when I try with a WEB Core app.

I verified that I can successfully invoke the server .well-known/openid-configuration, and I get the following JSON back when I invoke it:

{
    "issuer": "http://localhost:2001/tms/sphinx",
    "authorization_endpoint": "http://localhost:2001/tms/sphinx/oauth/authorize",
    "token_endpoint": "http://localhost:2001/tms/sphinx/oauth/token",
    "response_types_supported": [
        "code",
        "id_token",
        "id_token token"
    ],
    "token_endpoint_auth_methods_supported": [
        "client_secret_post",
        "client_secret_basic"
    ]
}

The server has the following for clients:

Client := SphinxConfig1.Clients.Add;
  Client.ClientId := 'web';
  Client.DisplayName := 'My web app';
  Client.RedirectUris.Add('http://localhost:8000/cardinal');
  Client.RequireClientSecret := False;
  Client.AllowedGrantTypes := [TGrantType.gtAuthorizationCode, TGrantType.gtRefreshToken];
  Client.ValidScopes.Add('openid');
  Client.ValidScopes.Add('email');
  Client.ValidScopes.Add('offline_access');

  Client := SphinxConfig1.Clients.Add;
  Client.ClientId := 'app';
  Client.DisplayName := 'My web app';
  Client.RedirectUris.Add('http://127.0.0.1');
  Client.RequireClientSecret := False;
  Client.AllowedGrantTypes := [TGrantType.gtAuthorizationCode, TGrantType.gtRefreshToken];
  Client.ValidScopes.Add('openid');
  Client.ValidScopes.Add('email');
  Client.ValidScopes.Add('offline_access');

And the client is configured as follows:

  SphinxWebLogin1.Name := 'SphinxWebLogin1';
  SphinxWebLogin1.Authority := 'http://localhost:2001/tms/sphinx';
  SphinxWebLogin1.ClientId := 'web';
  SphinxWebLogin1.Scope := 'openid email offline_access';
  SphinxWebLogin1.RedirectUri := 'http://localhost:8000/cardinal';

What am I missing here?

Thanks!

1 Like

I don't know. It looks ok.
Have you checked the exiting working Sphinx demo and see what does your application have different from it? What you posted here doesn't have almost anything different from it, so you can simply tweak the demo with your client information and see if your web app connects to it.

Yes, I did. I made a side by side comparison and I could not see any differences.
I would like to try the demo, however, I cannot compile the web client. I get a ‘Invalid build config’. Do you know what is going on?

I don't see any problem in compiling the web client demo here, using latest version of TMS Web Core.

Even if you can't compile the web client demo, you can simply use the server as the Sphinx server for your web app.