Code Monkey home page Code Monkey logo

angular-go-kratos-ui's Introduction

Angular Kratos Ui

This is example of implementation Kratos ui with Angular framework. Here I was trying to replicate default Kratos Node UI forms.

Start

make start

cd frontend
npm run start

Architecture

Alt text

Notes

This is unusual how we can pass env parameters into kratos.yml. For more information you can read this links:

Basicaly we need to get absolute "path" to your yaml variable like in json file, but instead of dots - use underscore sign, and all should be uppercase. Like this:

selfservice:
  methods:
    oidc:
      config:
        providers:
          - id: google
            client_id: "should be secret"
            client_secret: "should be secret"

Transforms into this 2 variables:

SELFSERVICE_METHODS_OIDC_CONFIG_PROVIDERS_0_CLIENT_ID=
SELFSERVICE_METHODS_OIDC_CONFIG_PROVIDERS_0_CLIENT_SECRET=

Zero in variable name is number of provider in providers array. So if you will have multiple providers - it will be:

SELFSERVICE_METHODS_OIDC_CONFIG_PROVIDERS_0_CLIENT_ID=
SELFSERVICE_METHODS_OIDC_CONFIG_PROVIDERS_0_CLIENT_SECRET=
SELFSERVICE_METHODS_OIDC_CONFIG_PROVIDERS_1_CLIENT_ID=
SELFSERVICE_METHODS_OIDC_CONFIG_PROVIDERS_1_CLIENT_SECRET=
SELFSERVICE_METHODS_OIDC_CONFIG_PROVIDERS_2_CLIENT_ID=
SELFSERVICE_METHODS_OIDC_CONFIG_PROVIDERS_2_CLIENT_SECRET=

Not tested yet with multiple providers, but I asume it should work some thing like this.

About social login

How it works localy. In https://console.cloud.google.com/ I have this redirect url:

http://localhost:4433/self-service/methods/oidc/callback/google

Create google.jsonnet file:

local claims = {
  email_verified: true,
} + std.extVar('claims');

{
  identity: {
    traits: {
      [if 'email' in claims && claims.email_verified then 'email' else null]: claims.email,
      name: {
        first: claims.given_name,
        last: claims.family_name,
      },
    },
  },
}

This config allow you to save user first and last name into identity while registration. Official documentation propose this example which obviously, will not works if you do not add them into identity.schema.json. I decided to update example jsonnet file and add "name" propery like in identity.schema.json. The hd claim is:

For Google, you can use the hd claim which is the hosted Google Workplace domain of the user. This claim is used only when the user has a Google Workspace account. To learn more about the ID payload returned by Google, read the related documentation.

So, this variable is also absent in my jsonnet.

Notes

Current configuration has open kratos:4433 public port. Later I'll hide it by oathkeeper and handle forms submittions by beckend service

angular-go-kratos-ui's People

Contributors

shaninalex avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

nordthing

angular-go-kratos-ui's Issues

setup google smtp courier

Remember! - It has been many years since Google stopped supporting user_password for SMTP. This password is generated as an 'App Password,' . How to create it described here

Profile avatar

  • Profile form should contain file upload field
  • After social signin avatar field should be filled with social account avatar

Angular 17 Update

The recent release of the Angular 17 and the default stand-alone for components has made some integrations a little more interesting. Do you have any intention of upgrading your code to support it?

Also, do you actually try to use the @ory/kratos-client for the UI to communicate with Kratos? I was looking around for this, but could not find if you were leveraging their code.

Thanks,

Create single input component

Instead of rendering form through loop and check every node - create general input component that will check everything inside itself.

Clean up the mess in ngrx

  • Declare proper types
  • do not use deprecated createFeatureSelector
  • Create selector to return not verified email addresses, show them on verification page
  • Hide verification page if all email addresses are verified

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.