Solution Review: Use JWT Token and Calls a JAX-RS Endpoint
Explore the solution to the “Use JWT Token and Call a JAX-RS Endpoint” challenge.
We'll cover the following...
We'll cover the following...
Solution
package be.rubus.workshop.security.challenge3.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "users")
public class User {
@Id
@Column(length = 64)
private String name;
@Column
private String password;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof User)) {
return false;
}
User user = (User) o;
return name.equals(user.name);
}
@Override
public int hashCode() {
return name.hashCode();
}
}
Solution: Use the JWT token and call a JAX-RS endpoint
Note: Enter the username and password educative/educative in the browser popup. After entering the credentials, go to the link given in the widget. ...