Replies: 5 comments 5 replies
-
|
As mentioned before I don't really understand what problem you are trying to solve here; if you are writing a test that is not expected to show a login form, well then don't make it try to fill the login form by using |
Beta Was this translation helpful? Give feedback.
-
|
We have code that configures the authorization request in non-trivial ways for example by providing authorization details that might be invalid. Depending on whether From a pure Java perspective, it is such that The problem I'm trying to solve is to make IMHO,
In the case of authorization code flow, |
Beta Was this translation helpful? Give feedback.
-
|
Perhaps you could let us know why adding this simple pre-condition check
It is well possible that I'm missing a crucial part here. AFAICT, existing code will not be effected and future code will not have to do things differently. There are about 100 places where Code that deals with invalid authorization requests already calls |
Beta Was this translation helpful? Give feedback.
-
|
@tdiesler +1 to what @stianst mentioned. The method
For any other use-case (EG. Opening login form, which is followed directly by redirect to the client without username/password screen being shown), the different methods should be used (EG. for that case, direct use of Using There is no reason why OID4VCI tests should do things differently than all other Keycloak tests. I've sent you the PR to your branch to fix the OID4VCI tests , which updates your PR to Keycloak . |
Beta Was this translation helpful? Give feedback.
-
|
I believe here is another example that runs into a selenium exception Its easy to spot those because they always run into a timeout (i.e. 10sec) before they throw that ugly selenium exception. Nevermind for now, in the the not so distant future we will have non-interactive authorization requests that might even replace code-flow authorization for oid4vci. With code flow, there are two classes of error that can happen ...
In headless environments it would be important to fail early - the response cannot be an html error page. In the fapi2 conformance test suite, there are a bunch of test modules that verify that there is a proper error redirect to the client (i.e. error + error_description on the redirect_uri) I still think the first class of errors can/should be handled by |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
This discussion is about invalid authorization requests and error error handling thereof.
Happy Flow
Lets consider the easy case whereby there need to be some additional parameters on the authorization request.
In this case
code_challengeandcode_challengebecause the client requires it.The
doLoginmethod internally executes this sequence ...Error Flow - Option A
Let's assume we want to test the error response when the required
code_challengeis not given.The authorization request is invalid,
open()does not display a login page, whichdoLogin()ignores, the root cause of theserver error is lost.
Option A (the current state of affairs) states that the caller "MUST know the outcome of the authorization request in advance and use the API accordingly".
Hence,
doLoginmust not be used ...This effectively skips the second step
client.fillLoginForm(username, password)because the caller expects thatopen()returns an error response.Error Flow - Option B
Option B states that the caller should not be required to know the outcome of the authorization request in advance. Instead, the API is expected to handle the error case internally.
The
doLoginmethod handles the error internally, conceptually like this ...In summary this discussion is about nothing more than making the call to
fillLoginForm(username, password)conditional on the successful display of the login page.Beta Was this translation helpful? Give feedback.
All reactions