{"id":25308803,"url":"https://github.com/darkness4/basic-oidc-go","last_synced_at":"2025-07-03T15:12:54.138Z","repository":{"id":274142659,"uuid":"702139568","full_name":"Darkness4/basic-oidc-go","owner":"Darkness4","description":"Example of usage with Go-OIDC","archived":false,"fork":false,"pushed_at":"2023-10-09T00:08:24.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-07T09:00:05.476Z","etag":null,"topics":["go","oauth2","oidc"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Darkness4.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-08T16:00:30.000Z","updated_at":"2023-10-09T00:34:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"7e1b2af1-5298-4c60-b5fb-4466db17bd59","html_url":"https://github.com/Darkness4/basic-oidc-go","commit_stats":null,"previous_names":["darkness4/basic-oidc-go"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Darkness4/basic-oidc-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Darkness4%2Fbasic-oidc-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Darkness4%2Fbasic-oidc-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Darkness4%2Fbasic-oidc-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Darkness4%2Fbasic-oidc-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Darkness4","download_url":"https://codeload.github.com/Darkness4/basic-oidc-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Darkness4%2Fbasic-oidc-go/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263348437,"owners_count":23452887,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","oauth2","oidc"],"created_at":"2025-02-13T12:35:52.471Z","updated_at":"2025-07-03T15:12:54.116Z","avatar_url":"https://github.com/Darkness4.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Basic OIDC example in Go\n\n## Usage\n\nFill a `.env` with the OIDC issuer URL, client secret and client ID:\n\n```shell\nCLIENT_SECRET=GOCSPX-0123456789abcdefghijklmnopqr\nCLIENT_ID=123456789012-0123456789abcdefghijklmnopqrstuv.apps.googleusercontent.com\nOIDC_ISSUER=https://accounts.google.com\n```\n\nLaunch the server:\n\n```shell\ngo run main.go\n```\n\nGo to the login page: [http://localhost:3000/login](http://localhost:3000/login).\n\n## With Dex\n\nConfigure the dex by editing the `dex/config.yaml`. Remove or add providers.\n\nRun the dex server by running the `dex/run.sh` script.\n\nLaunch the server:\n\n```shell\ngo run main.go\n```\n\nGo to the login page: [http://localhost:3000/login](http://localhost:3000/login).\n\n## With 389ds and dex\n\nRun the 389ds server by running the `run.sh` script.\n\nInitialize the server:\n\n```shell\ndocker exec -it 389ds bash\n\ndsconf localhost backend create --suffix dc=example,dc=com --be-name example_backend # Create a backend (a backend is literally a database)\ndsidm localhost initialise # Creates examples\n# Create a user\ndsidm -b \"dc=example,dc=com\" localhost user create \\\n  --uid example-user \\\n  --cn example-user \\\n  --displayName example-user \\\n  --homeDirectory \"/dev/shm\" \\\n  --uidNumber -1 \\\n  --gidNumber -1\n# Set a user password:\ndsidm -b \"dc=example,dc=com\" localhost user modify \\\n  example-user add:userPassword:\"....\"\ndsidm -b \"dc=example,dc=com\" localhost user modify \\\n  example-user add:mail:example-user@example.com\n```\n\nEdit the dex configuration to include LDAP:\n\n```yaml\n#config.yaml\n#...\nconnectors:\n  - type: ldap\n    id: ldap\n    name: LDAP\n    config:\n      host: \u003cyour-host-IP\u003e:3389 # EDIT THIS. If you use docker-compose with root, you can set a domain name.\n      insecureNoSSL: true\n      userSearch:\n        baseDN: ou=people,dc=example,dc=com\n        username: uid\n        idAttr: uid\n        emailAttr: mail\n        nameAttr: cn\n        preferredUsernameAttr: uid\n      groupSearch:\n        baseDN: ou=groups,dc=example,dc=com\n        userMatchers:\n          - userAttr: uid\n            groupAttr: member\n        nameAttr: cn\n```\n\nRun the dex server by running the `dex/run.sh` script.\n\nLaunch the server:\n\n```shell\ngo run main.go\n```\n\nGo to the login page: [http://localhost:3000/login](http://localhost:3000/login).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkness4%2Fbasic-oidc-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarkness4%2Fbasic-oidc-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkness4%2Fbasic-oidc-go/lists"}