{"id":20606791,"url":"https://github.com/jochumdev/ng2-ui-auth-example","last_synced_at":"2025-04-15T02:45:00.968Z","repository":{"id":57505601,"uuid":"96331603","full_name":"jochumdev/ng2-ui-auth-example","owner":"jochumdev","description":"Example of ng2-ui-auth (Angular 4 OAuth) with a go server","archived":false,"fork":false,"pushed_at":"2018-02-08T17:10:27.000Z","size":259,"stargazers_count":16,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-15T02:44:55.714Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://ng2-satellizer.pc-dummy.net/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jochumdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-05T15:01:13.000Z","updated_at":"2022-07-17T04:36:00.000Z","dependencies_parsed_at":"2022-09-19T13:51:07.669Z","dependency_job_id":null,"html_url":"https://github.com/jochumdev/ng2-ui-auth-example","commit_stats":null,"previous_names":["pcdummy/ng2-ui-auth-example"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jochumdev%2Fng2-ui-auth-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jochumdev%2Fng2-ui-auth-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jochumdev%2Fng2-ui-auth-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jochumdev%2Fng2-ui-auth-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jochumdev","download_url":"https://codeload.github.com/jochumdev/ng2-ui-auth-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248997087,"owners_count":21195797,"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":[],"created_at":"2024-11-16T09:34:43.603Z","updated_at":"2025-04-15T02:45:00.952Z","avatar_url":"https://github.com/jochumdev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## ng2-ui-auth-example - OAuth with [ng2-ui-auth](https://github.com/ronzeidman/ng2-ui-auth) and a Go server\n\n### Online Demo\n\n- I run this at [ng2-satellizer.pc-dummy.net](https://ng2-satellizer.pc-dummy.net).\n\n### Requirements to run your own\n\n- Go 1.7+ (I use [gvm](https://github.com/moovweb/gvm) for that).\n- Nodejs (I use [nvm](https://github.com/creationix/nvm) inside a pyenv venv).\n- GNU make to build the go server.\n- An account on at least one of Google, Facebook, Github to test it.\n\n### Usage\n\n1. `go get github.com/pcdummy/ng2-ui-auth-example`\n2. `cd $GOPATH/src/github.com/pcdummy/ng2-ui-auth-example`\n3. `cp secrets.ini.tmpl to secrets.ini`\n4. Goto Google, Facebook and Github and create an OAuth app.\n5. Paste the ClientId and the Secret into your secrets.ini.\n6. Install node, npm and go 1.7+\n7. Run `make` to build the go server\n8. Build the angular client: `cd client/; yarn install \u0026\u0026 yarn build`\n9. Run the server: `cd ..; ng2uiauthexampled --config dev.ini serve`\n\n### NGINX Config\n\nThis is my nginx.conf, in the case you want to host your own demo:\n\n```\nerror_log /var/log/nginx/error.log;\nevents {\n    use epoll;\n    worker_connections 1024;\n}\nhttp {\n    access_log /var/log/nginx/access.log;\n    client_max_body_size 150m;\n    default_type application/octet-stream;\n    error_log /var/log/nginx/error.log;\n    gzip on;\n    gzip_static on;\n    gzip_buffers 16 8k;\n    gzip_comp_level 6;\n    gzip_disable msie6;\n    gzip_http_version 1.1;\n    gzip_min_length 256;\n    gzip_proxied expired no-cache no-store private auth;\n    gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml image/x-icon;\n    gzip_vary on;\n    keepalive_timeout 65;\n    sendfile on;\n    server_names_hash_bucket_size 128;\n    server_tokens off;\n    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA;\n    ssl_prefer_server_ciphers on;\n    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;\n    ssl_session_cache shared:SSL:50m;\n    ssl_session_timeout 1d;\n    tcp_nodelay on;\n    tcp_nopush on;\n    types_hash_max_size 2048;\n\n    include /etc/nginx/mime.types;\n    include /etc/nginx/conf.d/*.conf;\n    include /etc/nginx/sites-enabled/*;\n}\npid /run/nginx.pid;\nuser www-data;\nworker_processes 4;\nworker_rlimit_core 500M;\nworking_directory /tmp/;\n\nserver {\n    server_name ng2-satellizer.pc-dummy.net;\n    server_tokens off;\n    access_log /var/log/nginx/ng2-satellizer.pc-dummy.net-access.log;\n    error_log /var/log/nginx/ng2-satellizer.pc-dummy.net-error.log;\n    listen 443 ssl http2;\n    listen [::]:443 ssl http2;\n    index index.html;\n    charset utf-8;\n\n    location ~ /.well-known {\n        root /var/www/letsencrypt;\n        allow all;\n    }\n    ssl_certificate /etc/letsencrypt/live/ng2-satellizer.pc-dummy.net/fullchain.pem;\n    ssl_certificate_key /etc/letsencrypt/live/ng2-satellizer.pc-dummy.net/privkey.pem;\n    ssl_dhparam /etc/letsencrypt/live/ng2-satellizer.pc-dummy.net/dhparam.pem;\n    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;\n    ssl_prefer_server_ciphers on;\n    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA;\n    ssl_session_timeout 1d;\n    ssl_session_cache shared:SSL:50m;\n    ssl_stapling on;\n    ssl_stapling_verify on;\n    add_header Strict-Transport-Security max-age=15768000;\n\n    location / {\n        index index.html;\n        try_files $uri $uri/ @rewrites;\n    }\n\n    location @rewrites {\n        rewrite ^ /index.html last;\n    }\n    root /var/www/lxdweb/static/;\n\n    location /api/ {\n        proxy_set_header Host $host;\n        proxy_set_header X-Real-IP $remote_addr;\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n        proxy_set_header X-Forwarded-Proto https;\n        proxy_pass http://localhost:8081;\n        proxy_connect_timeout 75;\n        proxy_read_timeout 185;\n    }\n}\n\nserver {\n    server_name ng2-satellizer.pc-dummy.net;\n    server_tokens off;\n    access_log /var/log/nginx/ng2-satellizer.pc-dummy.net-access.log;\n    error_log /var/log/nginx/ng2-satellizer.pc-dummy.net-error.log;\n    listen 80;\n    listen [::]:80;\n\n    location ~ /.well-known {\n        root /var/www/letsencrypt;\n        allow all;\n    }\n    return 301 https://ng2-satellizer.pc-dummy.net;\n}\n\n```\n\n\n### TODO\n\n### Authors\n\n- René Jochum @pcdummy\n\n### License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjochumdev%2Fng2-ui-auth-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjochumdev%2Fng2-ui-auth-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjochumdev%2Fng2-ui-auth-example/lists"}