Skip to content

Improve oauth2#3014

Open
flobz wants to merge 6 commits intoeclipse-hawkbit:masterfrom
flobz:fix/oauth2
Open

Improve oauth2#3014
flobz wants to merge 6 commits intoeclipse-hawkbit:masterfrom
flobz:fix/oauth2

Conversation

@flobz
Copy link
Copy Markdown
Contributor

@flobz flobz commented Apr 14, 2026

This PR add the following imrpovement:

  • fix npe when claim not found
  • fix token send for auth should be access token not id token
  • add ability to add custom header to oauth2 token request
  • update docs

@flobz flobz force-pushed the fix/oauth2 branch 3 times, most recently from 31fa6ba to ffcebf4 Compare April 17, 2026 15:25
Comment thread docs/authorization.md
Comment thread docs/authorization.md Outdated
@flobz flobz force-pushed the fix/oauth2 branch 2 times, most recently from ff319fd to 6117845 Compare April 23, 2026 14:11
Copy link
Copy Markdown
Contributor

@desislava-marinova desislava-marinova left a comment

Choose a reason for hiding this comment

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

LGTM

Comment thread hawkbit-core/pom.xml Outdated
public GroupedOpenApi mgmtApi(
@Value("${hawkbit.server.openapi.mgmt.tenant-endpoint.enabled:false}") final boolean tenantEndpointEnabled,
@Value("${hawkbit.server.security.oauth2.resourceserver.enabled:false}") final boolean oauth2Enabled,
@Value("${hawkbit.server.security.allow-http-basic-on-o-auth-enabled:false}") final boolean allowBasicAuthWithOauth,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I see here you are using the configuration for the hawkbit resource server.
Wouldn't be better to just get HawkbitSecurityProperties directly and check directly?
This way you will be safe against properties changes in the future

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

here you don't have both basic + oauth (as this is supported by hawkbit)?

Copy link
Copy Markdown
Contributor

@avgustinmm avgustinmm Apr 30, 2026

Choose a reason for hiding this comment

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

My idea was to have parameters:

@Autowired(required = false) @Qualifier("hawkbitOAuth2ResourceServerCustomizer") final Customizer<OAuth2ResourceServerConfigurer<HttpSecurity>> oauth2ResourceServerCustomizer,
final HawkbitSecurityProperties securityProperties

and to have:

if (oauth2ResourceServerCustomizer != null) {
    // add oauth
}
if (oauth2ResourceServerCustomizer == null || securityProperties.isAllowHttpBasicOnOAuthEnabled()) {
    // add basic
}

Alike MgmtSecurityConfiguration#filterChainREST

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.

3 participants