javax.ws.rs.core

Interface SecurityContext


  • public interface SecurityContext
    An injectable interface that provides access to security related information.
    Since:
    1.0
    Author:
    Paul Sandoz, Marc Hadley
    See Also:
    Context
    • Field Detail

      • CLIENT_CERT_AUTH

        static final String CLIENT_CERT_AUTH
        String identifier for Client Certificate authentication. Value "CLIENT_CERT"
        See Also:
        Constant Field Values
      • DIGEST_AUTH

        static final String DIGEST_AUTH
        String identifier for Digest authentication. Value "DIGEST"
        See Also:
        Constant Field Values
    • Method Detail

      • getUserPrincipal

        Principal getUserPrincipal()
        Returns a java.security.Principal object containing the name of the current authenticated user. If the user has not been authenticated, the method returns null.
        Returns:
        a java.security.Principal containing the name of the user making this request; null if the user has not been authenticated
        Throws:
        IllegalStateException - if called outside the scope of a request
      • isUserInRole

        boolean isUserInRole(String role)
        Returns a boolean indicating whether the authenticated user is included in the specified logical "role". If the user has not been authenticated, the method returns false.
        Parameters:
        role - a String specifying the name of the role
        Returns:
        a boolean indicating whether the user making the request belongs to a given role; false if the user has not been authenticated
        Throws:
        IllegalStateException - if called outside the scope of a request
      • isSecure

        boolean isSecure()
        Returns a boolean indicating whether this request was made using a secure channel, such as HTTPS.
        Returns:
        true if the request was made using a secure channel, false otherwise
        Throws:
        IllegalStateException - if called outside the scope of a request
      • getAuthenticationScheme

        String getAuthenticationScheme()
        Returns the string value of the authentication scheme used to protect the resource. If the resource is not authenticated, null is returned. Values are the same as the CGI variable AUTH_TYPE
        Returns:
        one of the static members BASIC_AUTH, FORM_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH (suitable for == comparison) or the container-specific string indicating the authentication scheme, or null if the request was not authenticated.
        Throws:
        IllegalStateException - if called outside the scope of a request

Nederlandse vertaling

U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.

Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.

Bij voorbaat dank.

Document heeft de 11/06/2005 gemaakt, de laatste keer de 18/08/2025 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-javaee-rf-javax/ws/rs/core/SecurityContext.html

De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.

Referenties

  1. Bekijk - html-document Taal van het document:fr Manuel PHP : https://docs.oracle.com, SecurityContext (Java(TM) EE 7 Specification APIs)

Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur van deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.