Giter VIP home page Giter VIP logo

example-oidc's Introduction

Table of content

CI

CI Platform Stauts
GitHub Action Windows GitHub-Actions-Img

How to run?

** use ie11 to run**

#34
⚠️ disable chrome samesite for test: chrome://flags/#same-site-by-default-cookies

docker-compose.yml (docker platform)

## start docker
docker-compose up --detach --build

## stop docker
docker-compose down

Update local /etc/hosts.

cat <<EOF >> /etc/hosts
127.0.0.1 traefik.test
127.0.0.1 oidc-server.test
127.0.0.1 oidc-client-hybrid.test
127.0.0.1 oidc-client-js.test
127.0.0.1 oauth2-resources-nodejs.test
127.0.0.1 oauth2-resources-aspnetcore.test
127.0.0.1 oauth2-resources-java.test
127.0.0.1 oauth2-client-aspnetcore.test
EOF

build.ps1 (windows platform)

Use administrator run build.ps1 to deploy demo web site to local IIS. Required :

  1. vs 2019 16.4 +
  2. .net framework 4.6.1 sdk
  3. .net core 3.1 sdk
  4. ASP.NET Core Module
build.ps1 -help

build.ps1 -target {Task}

Task                          Description
================================================================================
clean                         清理项目缓存
restore                       还原项目依赖
build                         编译项目
deploy-iis                    部署到本机IIS
open-browser                  用浏览器打开部署的站点
default                       默认执行open-browser

Deployed web site

web site docker windows description
http://traefik.test reverse proxy : traefik
http://oidc-server.test oidc server : asp.net core 3.1
http://oidc-client-hybrid.test oidc client : asp.net core 3.1
http://oidc-client-implicit.test oidc client : asp.net owin 4
http://oidc-client-js.test oidc client : html js(use access_token call resource api)
http://oauth2-resources-aspnetcore.test   oauth2 resources api : asp.net core 3.1
http://oauth2-resources-nodejs.test oauth2 resources api : node.js
http://oauth2-resources-java.test oauth2 resources api : java (spring boot)
http://oauth2-resources-owin.test oauth2 resources api : asp.net webapi 2
http://oauth2-client-aspnetcore.test oauth2 client : asp.net core 3.1
http://oauth2-client-owin.test oauth2 client : asp.net owin 4

OIDC Servers

  1. src/web.oidc.server.ids4 : ids4 (https://github.com/IdentityServer/IdentityServer4) example (with github, qqconnect external login).

OIDC Clients

  1. src/web.oidc.client.hybrid : web site, hybrid flow.
  2. src/web.oidc.client.implicit : web site, implicit flow.
  3. src/web.oidc.client.js : web site(static), implicit flow .
  4. src/uwp.oidc.client.authorization-code : uwp app, authorization code flow.
  5. src/wpf.oidc.client.authorization-code : wpf app, authorization code flow.

OAuth2 Clients

  1. src/web.oauth2.client.aspnetcore : asp.net core 3.1.
  2. src/web.oauth2.client.owin : asp.net owin.
  3. src/console.oauth2.client.client-credentials : console app, client credentials flow(oauth2).
  4. src/console.oauth2.client.resource-owner-password-credentials : console app, resource owner password credentials flow(oauth2).

OAuth2 Resources Servers

  1. src/web.oauth2.resources.aspnetcore: asp.net core 3.1.
  2. src/web.oauth2.resources.owin: asp.net owin.
  3. src/web.oauth2.resources.nodejs: node.js.
  4. src/web.oauth2.resources.java: java (spring boot 2.2.1).

OAuth2 Middleware

  1. src/oauth2.github.aspnetcore: asp.net core 3.1.
  2. src/oauth2.qqconnect.aspnetcore: asp.net core 3.1.
  3. src/oauth2.qqconnect.owin: asp.net owin.

Global Config

If you want use QQ Connect or Github, please replace ClientId and ClientSercet in src/_shared/GlobalConfig.cs file.

public static class GlobalConfig
{
    public static class QQConnect
    {
        public static readonly string ClientId = "You App Id";
        public static readonly string ClientSecret = "You App Secret";
    }

    public static class Github
    {
        public static readonly string ClientId = "You App Id";
        public static readonly string ClientSecret = "You App Secret";
    }
}

Blog

Authentication and Authorization: http://www.cnblogs.com/linianhui/category/929878.html

OIDC in Action: http://www.cnblogs.com/linianhui/category/1121078.html

Old version(ids3 and owin)

  1. ids3: https://github.com/linianhui/example-oidc/tree/ids3
  2. ids4 and owin: https://github.com/linianhui/example-oidc/tree/owin

example-oidc's People

Contributors

dependabot[bot] avatar linianhui avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

example-oidc's Issues

感谢贴

阅读了博主的系列文 犹如醍醐灌顶之效 ! 打Call

退出登录的时候,好像没有看到文章所说的js脚本文件

文章:https://www.cnblogs.com/linianhui/p/oidc-in-action-sso.html#auto-id-12
在章节“第4步:OIDC-Server - 登出自身,返回包含IFrame的HTML”,里面提到“最后页面中包含一个js脚本文件,在页面load完成后,跳转到第2步中指定的post_logout_redirect_uri指向的回调页面”,这里所提到的js脚本是在哪个响应包里面包含的呢?我在抓包的时候,好像并没有看到。
请大佬有空解释下?
环境:docker + 仓库的main分支
登录方式:oidc-client-hybrid.test里面的Oidc Login

这里差了一个属性

ApplicationPool = new ApplicationPoolSettings()
{
Name = "ids3-dev",
IdentityType = IdentityType.LocalSystem,
//这个属性你的build.cake文件中没写,我本地运行的时候会报错
MaxProcesses=100 //“MaxProcesses”属性的值必须介于 1 和 2147483647 之间(含)。

        }

iis部署后,登录失败未跳转

感谢大佬的例子,实用性非常强。有两个问题请教下,这是用直接源码部署的没动过

  1. 客户端未登录跳转到oidc server,点击了登录还在原地没跳转回去,是什么情况?
    image
    image
    image

2.oidc server 直接访问登录页面,没有带returnUrl报错了,是否server端可以自登录呢?
image

运行失败

你好,我本身对.net不熟,想clone下来运行一下。结果报错:

image

可否提供docker image?

或者部署好的demo?(这个要求好像有点不要脸了)

我现在参照这篇文章尝试安装vs2015,然后再试试

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.