Module z_microsoft_oauth_service

Support routines for using Microsoft as an external identity provider.

Copyright © 2021 Marc Worrell

Authors: Marc Worrell (marc@worrell.nl).

Description

Support routines for using Microsoft as an external identity provider.

See: https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-v2-protocols#endpoints See: https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow

Function Index

auth_validated/3Fetch the validated user data from the id_token See https://docs.microsoft.com/en-us/azure/active-directory/develop/id-tokens.
authorize_url/3Return the authorization url for the OAuth permission dialog.
decode_jwt/1
fetch_access_token/5Exchange the code for an access token.
fetch_user_data/1
fetch_user_photo/1
oauth_version/0Return the major OAuth version being used.
title/1Return the service title for display in templates.

Function Details

auth_validated/3

auth_validated(AccessData, Args, Context) -> any()

Fetch the validated user data from the id_token See https://docs.microsoft.com/en-us/azure/active-directory/develop/id-tokens

authorize_url/3

authorize_url(RedirectUrl::binary(), StateId::binary(), Context::z:context()) -> {ok, map()}

Return the authorization url for the OAuth permission dialog.

decode_jwt/1

decode_jwt(JWT) -> any()

fetch_access_token/5

fetch_access_token(Code::binary(), AuthData::term(), Args::list(), QArgs::map(), Context::z:context()) -> {ok, map()} | {error, term()}

Exchange the code for an access token

fetch_user_data/1

fetch_user_data(AccessToken) -> any()

fetch_user_photo/1

fetch_user_photo(AccessToken) -> any()

oauth_version/0

oauth_version() -> pos_integer()

Return the major OAuth version being used

title/1

title(Context::z:context()) -> binary()

Return the service title for display in templates


Generated by EDoc