Charts and Console(2)Login and Proxy
JSON Web Token, JWT
<header>. <payload> . <signature>
header - A JSON (Base64 encoded) that has info about algorithm used
payload - A JSON(base64 encoded) that has info about the user
signature - A String that was generated using #1 + #2 + “secret”(that only the server knows), using the algorithm mentioned in #1
https://jwt.io/
payload is typically
User ID - username, email, image URL
Any ACL like: isAdmin, isManager etc
Server side, After OAuth2,
Generate JWT token and return it to the client
Verify JWT token for protected routes in the future requests
https://github.com/rajaraodv/react-redux-blog
https://medium.com/@rajaraodv/securing-react-redux-apps-with-jwt-tokens-fcfe81356ea0
https://blog.yorkxin.org/2013/09/30/oauth2-6-bearer-token
http://www.leftso.com/blog/139.html
https://github.com/leftso/demo-spring-boot-security-oauth2
oauth2
https://www.npmjs.com/package/client-oauth2
https://github.com/lynndylanhurley/redux-auth#oauthsigninbutton
http://sillycat.iteye.com/blog/2227060
JWT
https://medium.com/@rajaraodv/securing-react-redux-apps-with-jwt-tokens-fcfe81356ea0
https://github.com/rajaraodv/react-redux-blog
https://blog.yorkxin.org/2013/09/30/oauth2-6-bearer-token
http://www.leftso.com/blog/139.html
https://github.com/leftso/demo-spring-boot-security-oauth2
https://github.com/jackhutu/jackblog-react/search?utf8=%E2%9C%93&q=token&type=
Auto Spin
http://blog.csdn.net/sinat_20559947/article/details/49886557
https://github.com/OKaluzny/spring-boot-security-oauth2-google
package
"react-google-login": "2.9.3",
Login Button Page
import GoogleLogin from 'react-google-login';
const googleSuccess = (response) => {
//console.log(response.profileObj); console.log(response.profileObj.email);
console.log(response.profileObj.name);
window.location.pathname = '/courses'};
const googleFailure = (response) => {
//popup_closed_by_user //access_denied //immediate_failed //idpiframe_initialization_failed console.log(response.error);
window.location.pathname = '/'};
<GoogleLogin clientId=“xxxxxx.apps.googleusercontent.com" buttonText="Google Login" onSuccess={googleSuccess}
onFailure={googleFailure}
/>
We can use className="btn btn-primary” to change the button look and feel.
References:
http://sillycat.iteye.com/blog/2227060
http://sillycat.iteye.com/blog/2236954
https://github.com/tcompiegne/oauth2-resource-server-samples
https://github.com/tcompiegne/oauth2-server
https://github.com/tcompiegne/oauth2-client-samples
JWT
https://medium.com/@rajaraodv/securing-react-redux-apps-with-jwt-tokens-fcfe81356ea0
https://github.com/lynndylanhurley/redux-auth#installation
https://www.npmjs.com/package/client-oauth2
Charts and Console(2)Login and Proxy
猜你喜欢
转载自sillycat.iteye.com/blog/2391686
今日推荐
周排行