GithubHelp home page GithubHelp logo

akunzai / mikrotik-hotspot-oauth Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vzakharchenko/mikrotik-hotspot-oauth

0.0 0.0 0.0 2.66 MB

License: Apache License 2.0

JavaScript 64.90% HTML 35.10%

mikrotik-hotspot-oauth's Introduction

Keycloak Radius Hotspot

Build Status

Setup social and other Oauth/Saml integration with Keycloak Radius embedded server

Requirements

Getting Started

# activate the pnpm package manager
corepack enable

# install npm packages
pnpm install

# watch and serve a dev server at http://localhost:5173/login.html
# put your keycloak.json in ./public/
pnpm start

# build the project in production mode. The build artifacts will be stored in the `dist/` directory
pnpm build

How Keycloak Radius Hotspot works

  1. Authorization through Keycloak occurs by OpenID Connect.
  2. User selects on the login page the identity provider through which he wants to log in
  3. The result of a successful authorization is a JWT that contains a temporary session key.
  4. With this key, the User is authorized through Radius Server.
  5. Radius Server checks if this key is in the user session. And whether it was used.
  6. Radius Server successfully authorizing the user

Connection Schema

Cloud connection (Better to Use Radsec)

KeycloakRadius (1)

Proxy connection

KeycloakRadius

Setup, build and configure HotSpot page for Social Login

  1. Create Realm hotspotRealm
  2. Create Radius Client RadiusClientHotSpot
  3. Create OpenId client hotspotClient
  4. Setting your Hotspot DNS in "Valid Redirect URIs" and "Web Origins" HotspotClientConfiguration
  5. Add "Radius Session Password" Mapper HotSpotMapper HotSpotMapper2
  6. Download keycloak.json downloadKeycloakJson

Setup Mikrotik

  1. Download the hostpot.zip from the latest release, unzip and upload the login.html file and assets folder into /hotspot folder on device via
    • web UI
    • scp
    • ftp
    • winbox
  2. Download keycloak.json downloadKeycloakJson
  3. upload keycloak.json into /hotspot folder on device
  4. update Walled Garden. Add your keycloak host addWalledGarden KeycloakHostName

Facebook Login example

  1. Install Keycloak with embedded Radius Server

  2. install ngrok. Register ngrok

    ./ngrok authtoken <YOUR TOKEN>

  3. start ngrok

    ./ngrok http 8090
    Ngrok

  4. open keycloak goto realm and add Facebook Identity Provider SelectFacbook

  5. Copy Redirect URI Copy Redirect URI

  6. goto https://developers.facebook.com/ and create a new application CreateApp1CreateApp2FacebookLogin3Facebook4

  7. Insert Redirect URI from Step 7 Facebook5

  8. Get App Id and Secret from application (Settings->basic) Facebook6

  9. back to Keycloak and set this App Id and Secret Facebook7

  10. add facebook hosts to Walled Garden FacebookWalledGarden

    /ip hotspot walled-garden
    add comment=facebook dst-host=facebook.*
    add comment=facebook dst-host=*.facebook.*
    add comment=facebook dst-host=*.fbcdn.*
    add comment=facebook dst-host=*akamai*
    add comment=facebook dst-host=*atdmt*
    add comment=facebook dst-host=*fbsbx*
    add comment=common dst-host=www.google-analytics.com
  11. open hotspot page FacebookLoginHotspot FacebookLogin2

mikrotik-hotspot-oauth's People

Contributors

akunzai avatar vzakharchenko avatar

mikrotik-hotspot-oauth's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.