Ensure the given name is legal for JAAS configuration. Added for Bugzilla 30869, made protected for easy customization in case my implementation is insufficient, which I think is very likely. @param src The name to validate @return A string that's a valid JAAS realm name
(final String src)
| 580 | * @return A string that's a valid JAAS realm name |
| 581 | */ |
| 582 | protected String makeLegalForJAAS(final String src) { |
| 583 | String result = src; |
| 584 | |
| 585 | // Default name is "other" per JAAS spec |
| 586 | if (result == null) { |
| 587 | result = "other"; |
| 588 | } |
| 589 | |
| 590 | // Strip leading slash if present, as Sun JAAS impl |
| 591 | // barfs on it (see Bugzilla 30869 bug report). |
| 592 | if (result.startsWith("/")) { |
| 593 | result = result.substring(1); |
| 594 | } |
| 595 | |
| 596 | return result; |
| 597 | } |
| 598 | |
| 599 | |
| 600 | // ------------------------------------------------------ Lifecycle Methods |
no test coverage detected