{"id":22401744,"url":"https://github.com/whossname/azure_ad_openid","last_synced_at":"2025-07-31T16:30:51.695Z","repository":{"id":56824452,"uuid":"156946918","full_name":"whossname/azure_ad_openid","owner":"whossname","description":"Azure Active Directory authentication using OpenID","archived":false,"fork":false,"pushed_at":"2024-04-10T22:46:58.000Z","size":67,"stargazers_count":8,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-29T10:14:02.405Z","etag":null,"topics":["authentication","azure-active-directory","azure-ad","elixir","elixir-lang","openid","openid-client"],"latest_commit_sha":null,"homepage":"https://hexdocs.pm/azure_ad_openid/readme.html","language":"Elixir","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/whossname.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-10T04:20:31.000Z","updated_at":"2023-05-31T11:58:09.000Z","dependencies_parsed_at":"2022-09-01T09:20:44.952Z","dependency_job_id":null,"html_url":"https://github.com/whossname/azure_ad_openid","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whossname%2Fazure_ad_openid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whossname%2Fazure_ad_openid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whossname%2Fazure_ad_openid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whossname%2Fazure_ad_openid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/whossname","download_url":"https://codeload.github.com/whossname/azure_ad_openid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228267857,"owners_count":17893841,"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":["authentication","azure-active-directory","azure-ad","elixir","elixir-lang","openid","openid-client"],"created_at":"2024-12-05T09:08:11.435Z","updated_at":"2024-12-05T09:08:12.148Z","avatar_url":"https://github.com/whossname.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Azure Active Directory OpenID\n\n[![Build Status](https://travis-ci.org/whossname/azure_ad_openid.svg?branch=master)](https://travis-ci.org/whossname/azure_ad_openid)\n[![Hex Version](https://img.shields.io/hexpm/v/azure_ad_openid.svg)](https://hex.pm/packages/azure_ad_openid)\n[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)\n\n\nAzure Active Directory authentication using OpenID.\n\nThis is a simple and opinionated OpenID authentication library for Azure Active Directory.\nThe following decisions have been made:\n\n- The nonce has a timeout of 15 minutes\n- The callback will reject id_tokens with an iat that is more than 6 minutes old\n\n## Installation\n\nThe package can be installed by adding `azure_ad_openid` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:azure_ad_openid, \"~\u003e 0.2\"},\n  ]\nend\n```\n\n## Basic Usage\n\nThis library can be used with or without the standard Elixir configuration. If you want to\nuse it with configuration set the following in your config files:\n\n```elixir\nconfig :azure_ad_openid, AzureADOpenId,\n  tenant: \u003cyour tenant\u003e,\n  client_id: \u003cyour client_id\u003e,\n  client_secret: \u003c\u003e, # only needed to generate access tokens\n  aud: \u003c\u003e # used to overide client_id as the value for aud\n```\n\nIf you don't setup the config, you will need to pass these values in manually at runtime.\nFor example to get the authorization url:\n\n```elixir\nconfig = [tenant: \u003cyour tenant\u003e, client_id: \u003cyour client_id\u003e]\nAzureADOpenId.authorize_url!(\u003credirect_uri\u003e, config)\n```\n\nThe following is a simple example of a Phoenix authentication controller that uses this library:\n\n```elixir\ndefmodule MyAppWeb.AuthController do\n  use MyAppWeb, :controller\n\n  alias AzureADOpenId\n\n  def login(conn, _) do\n    base_uri = Application.get_env(:my_app, :base_uri)\n    redirect_uri = \"#{base_uri}/auth/callback\"\n    redirect conn, external: AzureADOpenId.authorize_url!(redirect_uri)\n  end\n\n  def callback(conn, _) do\n    {:ok, claims} = AzureADOpenId.handle_callback!(conn)\n\n    conn\n    |\u003e put_session(:user_claims, claims)\n    |\u003e redirect(to: \"/\")\n  end\n\n  def logout(conn, _) do\n    conn\n    |\u003e put_session(:user_claims, nil)\n    |\u003e redirect(external: AzureADOpenId.logout_url())\n  end\nend\n```\n\n## Documentation\n\nThe docs can be found at\n[https://hexdocs.pm/azure_ad_openid ](https://hexdocs.pm/azure_ad_openid/readme.html).\n\n## Credit\n\nThe following repository was used as a base for the AzureAD authentication:\n\n[https://github.com/onurkucukkece/oauth_azure_activedirectory ](https://github.com/onurkucukkece/oauth_azure_activedirectory)\n\n## License\n\nPlease see [LICENSE](https://github.com/whossname/azure_ad_openid/blob/master/LICENSE.md)\nfor licensing details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhossname%2Fazure_ad_openid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhossname%2Fazure_ad_openid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhossname%2Fazure_ad_openid/lists"}