Git Product home page Git Product logo

keyonic-v2's Introduction

Keyonic-V2

A Keycloak Mobile Implementation using Angular v4 and Ionic v3.

Version 2 Enhancements

  • Implementation with Angular 4/Typescript/Ionic 3
  • ViewGuard - View level access is protected based on a Role
  • More Keycloak functions used and information served

Requirements

  • Apache Cordova
  • Node 6 LTS
  • Ionic 3
  • Keycloak Server

Install Cordova & Ionic

  • npm install -g ionic cordova

Use Node 6

  • nvm use 6.9

Installation

Run ionic serve --address localhost to start the application.

Note: You must first have the Keycloak Server running with a configured Realm and Users:

You can import the keyonic-v2 Realm (keyonic-v2-realm.json) and Users (keyonic-v2-users.json) JSON files here to populate Keycloak with the correct configuration.

  • Under the Realms section in Keycloak, add a new Realm with the Import option.
  • Import the keyonic-v2-realm.json file.
  • Once complete, visit the newly created realm and click the 'Import' button at the bottom left of the sidebar. You will import the users here. Choose the keyonic-v2-users.json file.

Note: You must first have a running Keycloak instance running as the Keycloak JS Adapter in the mobile app is being fetched from the Keycloak server itself, rather than via npm.

In this sample application, Keycloak is expected to be already running off localhost:8080. This can be changed however in src/index.html under <script src="http://localhost:8080/auth/js/keycloak.js"></script>

Ensure that you have the Web Origin configured in Keycloak. eg * or other. (This should be done when you import the realm)

Also ensure that the redirectUri for the client is pointing to where the ionic dev server is running. eg. http://localhost:8100/* (Only if your ionic app is running on a different URL)

Usage

User Credentials:

  • keypress-admin/admin

  • areader/123

  • apublisher/123

Bearer Example

For an example using bearer tokens for accessing a REST API, checkout the bearer_example branch here and in Keypress#bearer_example

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.