springOauth通过token得到用户信息
package org.springframework.security.oauth.samples;
import org.springframework.security.jwt.Jwt;
import org.springframework.security.jwt.JwtHelper;
public class M {
public static void main(String[] args) {
String token =
"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IlN3REpYam4yUzJ6VjQzNWZmcEhhN0d4SFdISGFMZFFwMmR4VitmdzduSjA9In0.eyJleHAiOjE1OTI0NDE4MTYsInVzZXJfbmFtZSI6InVzZXIxIiwiYXV0aG9yaXRpZXMiOlsiUk9MRV9VU0VSIl0sImp0aSI6IjcxN2MwZDdmLWEzMDMtNDMxZC1hN2ZkLTRhZjhhNjhhYmU3YSIsImNsaWVudF9pZCI6ImMiLCJzY29wZSI6WyJtZXNzYWdlLnJlYWQiLCJtZXNzYWdlLndyaXRlIl19.fCpQrRVErzI0ppHf7fHyzmh8BDyeIHjJvsLL_wvIxLNWH5hwXm5GT3a2PTbiKSX01jRPxRnGAO_a8cQU2SF6p3K9sCcbYRCYsvHLWVBjl2T0IeRFHRzZuZHBptSpRBuwPl3DtJMbonvRHb78MIyvIcahyYRJBs8vdvjv3DkF3y8jpQDsPCTaAZJERpXBViJKlrKX2PRGwPsNOBX9X1K9_XkXUn2wpaxv4b5IUalZBEwTk2bV4zby3h0UsfVB2IWHG0CQoM1j8b2DB-Qg08CGTWtKoaLTEvkaPPXZzeDQeGNKf46C1na8sMoWxU6pZAR-7dXK0Stl76IsuIrQjhFB-Q";
Jwt jwt = JwtHelper.decode(token);
System.out.println(jwt);
}
}
以上是 springOauth通过token得到用户信息 的全部内容, 来源链接: utcz.com/z/517552.html