0

I am writing a RESTful web service with Java and Glassfish 4. I successfully setup a jdbc realm. I am able to lock certain URLs through the web.xml. Now i want to have a resource which changes it´s value if the user is authorized or not. Example:

**Request:** 
exampleuser/information 
GET without BASIC Auth

**Response:**
username: example user
email: example@user.com

**Request:** 
exampleuser/information 
GET with BASIC Auth as exampleuser

**Response:**
username: example user
email: example@user.com
born: 1.1.1111
password: test

So i want to somehow check in the method if the user is authorized and based on that i want to return other information. how is that possible?

perotom
  • 851
  • 13
  • 33

1 Answers1

1

Take a look at this link, it should help you

Snorky35
  • 426
  • 6
  • 15