OAuth-Unterstuetzung fuer jdk.httpserver
ulrich
2021-06-15 6b3fc63826a10ceea241f1813181de07d692f5b5
src/de/uhilger/httpserver/oauth/BearerAuthenticator.java
@@ -22,7 +22,7 @@
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpPrincipal;
import de.uhilger.httpserver.auth.realm.Realm;
import de.uhilger.httpserver.base.handler.HttpResponder;
import de.uhilger.httpserver.base.HttpResponder;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.JwtException;
import io.jsonwebtoken.Jwts;
@@ -349,6 +349,14 @@
    this.realm = realm;
  }
  
  //public Realm getRealm() {
  //  return realm;
  //}
  public boolean hasRole(String userId, String roleId) {
    return realm.hasRole(userId, roleId);
  }
  public void setWWWAuthRealm(String wwwAuthRealm) {
    this.wwwAuthRealm = wwwAuthRealm;
  }