Skip to content

Commit

Permalink
New sample: Use NAA SSO from event-based code in Outlook add-in (Offi…
Browse files Browse the repository at this point in the history
…ceDev#832)

* initial commit

* add readme details

* clean up code and don't call acquireTokenPopup

* add task pane sign in feature

* add id placeholders

* use beta channel

* Add note for using dev build

* fix note formatting

* fix note formatting

* add info on outlook support

* add info link

* Apply suggestions from code review

Co-authored-by: Alex Jerabek <[email protected]>

* added fallback code to sign in using task pane

* Merge branch 'davech-event-naa' of https://github.com/OfficeDev/Office-Add-in-samples into davech-event-naa

* Updates to clean up code.

* updates to work in Outlook online

* Changes to confirm OWA and desktop support working

* add debug files for VS Code

* Apply suggestions from code review

Co-authored-by: Linda Cannon <[email protected]>

* applies to web

* update packages

* Update Samples/auth/Outlook-Event-SSO-NAA/src/launchevent/launchevent.js

Co-authored-by: Alex Jerabek <[email protected]>

---------

Co-authored-by: Alex Jerabek <[email protected]>
Co-authored-by: Linda Cannon <[email protected]>
  • Loading branch information
3 people authored Sep 10, 2024
1 parent 19667b5 commit d45edef
Show file tree
Hide file tree
Showing 27 changed files with 16,178 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Samples/auth/Outlook-Event-SSO-NAA/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"plugins": [
"office-addins"
],
"extends": [
"plugin:office-addins/recommended"
]
}
130 changes: 130 additions & 0 deletions Samples/auth/Outlook-Event-SSO-NAA/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
13 changes: 13 additions & 0 deletions Samples/auth/Outlook-Event-SSO-NAA/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp

// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"ms-edgedevtools.vscode-edge-devtools",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": []
}
34 changes: 34 additions & 0 deletions Samples/auth/Outlook-Event-SSO-NAA/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Direct Debugging",
"type": "node",
"request": "attach",
"port": 9223,
"timeout": 600000,
"trace": true
},
{
"name": "Outlook Desktop (Edge Chromium)",
"type": "msedge",
"request": "attach",
"port": 9229,
"timeout": 600000,
"webRoot": "${workspaceRoot}",
"preLaunchTask": "Debug: Outlook Desktop",
"postDebugTask": "Stop Debug"
},
{
"name": "Outlook Desktop (Edge Legacy)",
"type": "office-addin",
"request": "attach",
"url": "https://localhost:3000/taskpane.html?_host_Info=Outlook$Win32$16.01$en-US$$$$0",
"port": 9222,
"timeout": 600000,
"webRoot": "${workspaceRoot}",
"preLaunchTask": "Debug: Outlook Desktop",
"postDebugTask": "Stop Debug"
}
]
}
8 changes: 8 additions & 0 deletions Samples/auth/Outlook-Event-SSO-NAA/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript"
]
}

156 changes: 156 additions & 0 deletions Samples/auth/Outlook-Event-SSO-NAA/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Build (Development)",
"type": "npm",
"script": "build:dev",
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"clear": true,
"panel": "shared",
"showReuseMessage": false
}
},
{
"label": "Build (Production)",
"type": "npm",
"script": "build",
"group": "build",
"presentation": {
"clear": true,
"panel": "shared",
"showReuseMessage": false
}
},
{
"label": "Debug: Excel Desktop",
"type": "shell",
"command": "npm",
"args": [
"run",
"start:desktop",
"--",
"--app",
"excel"
],
"presentation": {
"clear": true,
"panel": "dedicated"
},
"problemMatcher": []
},
{
"label": "Debug: Outlook Desktop",
"type": "shell",
"command": "npm",
"args": [
"run",
"start:desktop",
"--",
"--app",
"outlook"
],
"presentation": {
"clear": true,
"panel": "dedicated"
},
"problemMatcher": []
},
{
"label": "Debug: PowerPoint Desktop",
"type": "shell",
"command": "npm",
"args": [
"run",
"start:desktop",
"--",
"--app",
"powerpoint"
],
"presentation": {
"clear": true,
"panel": "dedicated"
},
"problemMatcher": []
},
{
"label": "Debug: Word Desktop",
"type": "shell",
"command": "npm",
"args": [
"run",
"start:desktop",
"--",
"--app",
"word"
],
"presentation": {
"clear": true,
"panel": "dedicated"
},
"problemMatcher": []
},
{
"label": "Dev Server",
"type": "npm",
"script": "dev-server",
"presentation": {
"clear": true,
"panel": "dedicated"
},
"problemMatcher": []
},
{
"label": "Install",
"type": "npm",
"script": "install",
"presentation": {
"clear": true,
"panel": "shared",
"showReuseMessage": false
},
"problemMatcher": []
},
{
"label": "Lint: Check for problems",
"type": "npm",
"script": "lint",
"problemMatcher": [
"$eslint-stylish"
]
},
{
"label": "Lint: Fix all auto-fixable problems",
"type": "npm",
"script": "lint:fix",
"problemMatcher": [
"$eslint-stylish"
]
},
{
"label": "Stop Debug",
"type": "npm",
"script": "stop",
"presentation": {
"clear": true,
"panel": "shared",
"showReuseMessage": false
},
"problemMatcher": []
},
{
"label": "Watch",
"type": "npm",
"script": "watch",
"presentation": {
"clear": true,
"panel": "dedicated"
},
"problemMatcher": []
}
]
}
Loading

0 comments on commit d45edef

Please sign in to comment.