Created
February 9, 2018 11:23
-
-
Save hardselius/478f68b97a18c68d9981cf373416b9f3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Look at https://github.com/gambol99/keycloak-proxy for setting up the proxy and the rules 'n stuff. | |
| Basically, what you need to do is | |
| - create a client in Keycloak, | |
| - run the proxy from the command line, and | |
| - open a browser and | |
| bin/keycloak-proxy \ | |
| --discovery-url=http://localhost:8000/realms/telia \ | |
| --client-id=keycloak-proxy \ | |
| --client-secret=9a3a63d9-1b9d-4a33-bf3d-a6d60393cc2a \ | |
| --listen=127.0.0.1:3333 \ | |
| --redirection-url=http://localhost:3131 \ | |
| --enable-refresh-tokens=true \ | |
| --encryption-key=AgXa7xRcoClDEU0ZDSH4X0XhL5Qy2Z2j \ | |
| --upstream-url=http://localhost:3131 \ | |
| --skip-upstream-tls-verify=true \ | |
| --secure-cookie=false \ | |
| --resources="uri=/protected*|methods=GET|roles=user" | |
| This isn't fully working. Figure it out. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "net/http" | |
| ) | |
| func main() { | |
| http.Handle("/", http.FileServer(http.Dir("./resources/"))) | |
| http.ListenAndServe(":3131", nil); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- resources/open.html --> | |
| <html> | |
| <head> | |
| <title>DEMO</title> | |
| </head> | |
| <body> | |
| <h2>This is open</h2> | |
| <a href="protected.html">PROTECTED</a> | |
| </body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- resources/protected.html --> | |
| <html> | |
| <head> | |
| <title>DEMO</title> | |
| </head> | |
| <body> | |
| <h2>This is protected</h2> | |
| <a href="open.html">OPEN</a> | |
| <a href="oauth/logout?redirect=http://localhost:3333/open.html">LOGOUT</a> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment