Closed peavers closed 8 years ago
Hi @peavers. You are absolutely right. This was an oversight on my part and using the Principal is the correct thing to do here. See my last commit 572d43494cd8809e2cdf5c82d472563cb5d979c9. Hopefully this makes things a bit clearer.
Really appreciate the examples, has made this a lot easier to understand.
Hopefully someone can clarify this a bit for me (I'm new to this so apologies if it's obvious)
In the ExampleAuthenticator class you return an object of type Principal
Yet in SecuredResource example, the check-token is looking for an object of type User
As it never receives this, it throws a null pointer when trying to access user.getUsername. This can easily be fixed by either changing the expected type to Principal
Or changing the Authenticator to create a User object instead. What is the correct way here? Does it even matter, or have I completely missed something and got this all wrong?
Would love some advice/guidance