kohlton.jazeel
kohlton.jazeel

Reputation: 11

How to add spring security parameters in Postman?

I have added Spring Security in my project. It's working fine when I am requesting from browser, it simply ask my username and password and gives access to API. But now I tried from Postman. I tried passing username and password fields in headers but it is not allowing me to access API.

I am continuously getting 401 unauthorized in Postman.

Upvotes: 1

Views: 4699

Answers (2)

Salah dine Maham
Salah dine Maham

Reputation: 343

  • first create application security confige class like this :

enter image description here

  • Second go to you postMan and change the authentification type to basic like this :enter image description here

Upvotes: 0

Romas Augustinavičius
Romas Augustinavičius

Reputation: 443

Simply select "Authorization" tab and then the authorization method. Pretty clear in here https://learning.getpostman.com/docs/postman/sending_api_requests/authorization/

Faor your case choose "Basic" authorization

Upvotes: 1

Related Questions