Skip to content

Conversation

vvertinskiy
Copy link
Contributor

No description provided.

@Override
public void configure(Binder binder) {
ShiroWebModule.extend(binder).setFilter(OID_CONNECT_BEARER_AUTHENTICATION_FILTER_NAME, OidConnectFilter.class);
JerseyModule.extend(binder).addResource(JwtOpenIdCallbackHandler.class);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Directly registering JwtOpenIdCallbackHandler will only work for the default URL that will be taken from the annotation @Path("/bq-shiro-oauth-callback"). A custom callbackUri will be ignored. To handle custom endpoint URLs, you will need to remove the annotation, and create a "provide" method for MappedResource<JwtOpenIdCallbackHandler> that will allow setting up custom URLs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

return new JwtBearerAuthenticationFilter(tokenParser, this.audience);
}

public String provideAudience() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I forgot that the new filter will also need audience. I suppose we can keep it here for now, but after we merge the PR, I am thinking of refactoring both shirowebjwt and shiroweboidconnect config structure, so that we don't need to share properties (likely going back to your original idea of nested configurations were properties are organized by "filter", "callback", "jwks", etc.).

Anyways, no change is needed in this PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

import java.nio.charset.StandardCharsets;
import java.util.*;

public class OidConnectUtils {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this class doesn't have to be public

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

return params.toString();
}

static Map<String, Object> getOidpParametersMap(String baseUri, String originalUri, String clientId, String callbackUri) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this method is unused

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted

}

@GET
public Response callback(@Context UriInfo uriInfo) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We know the parameter names, so we can model them in the method signature using @QueryParam

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants