This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM tensorflow/tensorflow:1.13.1-py3 | |
RUN apt-get update && apt-get install -y \ | |
build-essential \ | |
cmake \ | |
git \ | |
wget \ | |
unzip \ | |
yasm \ | |
pkg-config \ | |
libswscale-dev \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Retrieve IDP signature keys. | |
*/ | |
async function updateIdpKeys(): Promise<Array<MSOpenIdKey>> { | |
const data = await rp({ uri: 'https://login.microsoftonline.com/common/discovery/v2.0/keys', json: true }); | |
if (data && data.keys && isArray(data.keys) && data.keys.length > 0) { | |
data.keys.forEach(async (k: MSOpenIdKey) => { | |
await db.collection('IdpKeys').doc(k.kid).set(k); | |
}); | |
keys = data.keys; // Store in container. Will be re-used when container is re-used |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.validateAuth = functions.https.onRequest(async (req, res) => { | |
if (req.query && req.query.error) { | |
console.error(`Authentication request error from Azure AD: ${req.query.error_description}. Full details: ${JSON.stringify(req.query)}`); | |
res.status(400).send(`Oh oh, something went wrong. Please contact support with the following message: Invalid authentication request: ${req.query.error_description}`); | |
return; | |
} | |
if (req.body && req.body.id_token) { | |
try { | |
const token = req.body.id_token; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Abbreviated version from https://github.com/Alex-Wauters/firebase-auth-azure-ad/blob/master/main.js | |
firebase.auth().onAuthStateChanged(function (user) { | |
if (user) { | |
console.log('User is logged in'); | |
startApp(); | |
} else { | |
const url = window.location.href; | |
if (url.indexOf('jwt=') > -1) { // The minted firebase token from Auth function | |
const token = url.substr( url.indexOf('jwt=') + 4); | |
firebase.auth().signInWithCustomToken(token) |