jakartaee / jakartaee/authorization
Convenience method for getting Subject
- Dominant language
- Java
- Stars
- 17
- Forks
- 20
- PR merge metrics
- No merged PRs in 30d
Description
The Subject (representing the authenticated identity) is currently obtained in Jakarta Authorization in the following way:
```java
Subject subject;
try {
subject = (Subject) PolicyContext.getContext("javax.security.auth.Subject.container");
} catch (PolicyContextException ex) {
throw new RuntimeException(ex);
}
```
We could for convenience and for ease of readability in the using code add a `getSubject()` method to `PolicyContext`
Contributor guide
Research direction
Start by reading the PolicyContext class and its existing getContext(String) API, then trace how the authenticated Subject is obtained in the reported Jakarta Authorization usage. Done means PolicyContext exposes getSubject() so callers can obtain the authenticated Subject without the shown lookup and exception-handling boilerplate.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- authorization
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100