question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support to scope definition when using KeycloakInstalled (desktop usage)

See original GitHub issue

Description

If you want to secure java desktop applications, the documentation recommendation is that you can use org.keycloak.keycloak-installed-adapter. Nonetheless, there aren’t any way to define scopes (or if there is, it isn’t documented).

Discussion

No response

Motivation

No response

Details

Currently, to define custom scopes, you’re need to reimplement KeycloakInstalled.

I made this following modifications: Replace this following lines: https://github.com/keycloak/keycloak/blob/c31d37ddf1c3e3529e761800a6842fdbf25ba931/adapters/oidc/installed/src/main/java/org/keycloak/adapters/installed/KeycloakInstalled.java#L241 https://github.com/keycloak/keycloak/blob/c31d37ddf1c3e3529e761800a6842fdbf25ba931/adapters/oidc/installed/src/main/java/org/keycloak/adapters/installed/KeycloakInstalled.java#L468 to this one:

.queryParam(OAuth2Constants.SCOPE, Optional.ofNullable(deployment.getScope()).orElse(OAuth2Constants.SCOPE_OPENID))

And, when specify the scope,

keycloak = new MyCustomKeycloakInstalled(targetStream);
keycloak.setLocale(Locale.getDefault());
keycloak.getDeployment().setScope(OAuth2Constants.SCOPE_OPENID + " mycustomscope");

Probably a better alternative is using keycloak.json configuration file. But unfortunately Jackson Parser throws an exception.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
pedroigorcommented, Jun 6, 2022

Looks like a valid requirement. We can probably just add a setScope method to do that, right?

If you are able to send a PR, I’m glad to review and merge.

0reactions
gelm0commented, Sep 6, 2022

Cool, I added a PR a few days ago. Have a look when you have time.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Securing Applications and Services Guide - Keycloak
Configuring a Docker registry to use Keycloak ... Keycloak supports both OpenID Connect (an extension to OAuth 2.0) and SAML 2.0.
Read more >
Define the Project Scope - Microsoft Desktop Optimization Pack
In this article. Define the MED-V End Users; Determine the MED-V Images to Be Managed by MED-V; Determine the Organization's Service Level ...
Read more >
A Beginner's Guide to Defining Project Scope - The Motley Fool
Project scope is vital to success as it defines goals and assesses what resources are needed. This simple guide will help you define...
Read more >
How to Write a Project Scope in 8 Easy Steps [2022] • Asana
1. Start with your project objectives ... Before you can define your project scope, you first need to outline your project objectives. Project ......
Read more >
9. Scope Planning – Project Management – 2nd Edition
Project scope planning is concerned with the definition of all the work ... of someone who will use the software, to support the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found