Skip to content

vuejs frontend calling a golang backend integrating with keycloak for userauth

lapd-frontend/vue-go-keycloak-auth

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

vue-go-keycloak-auth

Test & learning application to utilize a VueJs frontend with a Go backend speaking with Keycloak as identity provider.

  • the Go backend is exposing a REST endpoint /auth (POST) on localhost:5000, taking a JSON {"username":"[email protected]","password":"test"} and is delivering a JWT back if the username was [email protected], else HTTP/403 Forbidden
  • the VueJs frontend is providing a login screen on http://localhost:8080 and is logging the user into the /main route on success

image

Installation & How to Use

  • pull the jboss/keycloak image docker pull jboss/keycloak

  • start the image docker run -p 38080:8080 --name keycloak -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin jboss/keycloak

  • login to the keycloak admin console on http://localhost:38080/auth/ > Users > Add User > create the [email protected] user image

  • when the user is successfully created, on the Credentials tab, set test as new password for this user (make sure you switch Temporary off) image

  • start the backend cd backend; go run cmd/server/server.go

  • prep frontend node modules cd frontend; yarn

  • start the frontend yarn serve (in frontend) -> go to http://localhost:8080/ to use the frontend, login with [email protected]

image

About

vuejs frontend calling a golang backend integrating with keycloak for userauth

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vue 37.2%
  • Go 37.0%
  • JavaScript 21.7%
  • HTML 3.8%
  • Shell 0.3%