File tree Expand file tree Collapse file tree
src/main/java/edu/tamu/app/controller Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313import edu .tamu .app .model .User ;
1414import edu .tamu .app .model .repo .UserRepo ;
1515import edu .tamu .weaver .auth .annotation .WeaverCredentials ;
16+ import edu .tamu .weaver .auth .annotation .WeaverUser ;
1617import edu .tamu .weaver .auth .model .Credentials ;
1718import edu .tamu .weaver .response .ApiResponse ;
1819
@@ -50,6 +51,26 @@ public ApiResponse credentials(@WeaverCredentials Credentials credentials) {
5051 return new ApiResponse (SUCCESS , credentials );
5152 }
5253
54+ /**
55+ * Websocket endpoint to request credentials.
56+ *
57+ * @param shibObj
58+ * Object
59+ *
60+ * @return ApiResponse
61+ *
62+ * @throws Exception
63+ *
64+ */
65+ @ RequestMapping ("/user" )
66+ @ PreAuthorize ("hasRole('ANONYMOUS')" )
67+ public ApiResponse getUser (@ WeaverUser User user ) {
68+ if (user == null ) {
69+ return new ApiResponse (ERROR , "Unable to retrieve user!" );
70+ }
71+ return new ApiResponse (SUCCESS , user );
72+ }
73+
5374 /**
5475 * Returns all users.
5576 *
You can’t perform that action at this time.
0 commit comments