auth2
This commit is contained in:
1 parent
d35402cc6a
commit
6ac13817a4
7 files changed
+171
No files matched your search
@@ -0,0 +1,17 @@
|
||||
package com.ruoyi;
|
||||
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
|
||||
import java.util.Base64;
|
||||
|
||||
public class BCryptMain {
|
||||
public static void main(String[] args) {
|
||||
BCryptPasswordEncoder encoder =
|
||||
new BCryptPasswordEncoder();
|
||||
|
||||
System.out.println(
|
||||
encoder.encode("123456")
|
||||
);
|
||||
System.out.println(new String(Base64.getEncoder().encode("lu7213:123456".getBytes())));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.ruoyi.web.controller.openapi;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* http://127.0.0.1:2020/oauth/token
|
||||
* Basic Auth lu7213/123456
|
||||
* x-www-form-urlencoded
|
||||
* grant_type:client_credentials
|
||||
* scope:openapi
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/openapi/test")
|
||||
public class OpenApiController {
|
||||
|
||||
|
||||
@GetMapping
|
||||
public String test(){
|
||||
return "oauth2 ok";
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user