Skip to content
This repository was archived by the owner on Nov 23, 2026. It is now read-only.

Switch OAuth/OpenId Connect library - #525

Merged
scramb merged 7 commits into
masterfrom
feature/openid-connect-lib
Jan 29, 2019
Merged

scramb merged 7 commits into
masterfrom
feature/openid-connect-lib

Conversation

@DeepDiver1975

@DeepDiver1975 DeepDiver1975 commented Jan 21, 2019 •

Copy link
Copy Markdown
Contributor

Description

OAuth2 config will look like:

{
  "server": "http://localhost:8080",
  "theme": "owncloud",
  "version": "0.1.0",
  "auth": {
		"clientId": "Cxfj9F9ZZWQbQZps1E1M0BszMz6OOFq3lxjSuc8Uh4HLEYb9KIfyRMmgY5ibXXrU",
		"url": "http://localhost:8080/index.php/apps/oauth2/api/v1/token",
		"authUrl": "http://localhost:8080/index.php/apps/oauth2/authorize"
  },
  "apps" : [
    "files"
  ]
}

OpenId Connect:

{
	"server" : "http://deepdiver:8080",
	"theme": "owncloud",
	"version": "0.1.0",
	"auth" : {
		"clientId": "Cxfj9F9ZZWQbQZps1E1M0BszMz6OOFq3lxjSuc8Uh4HLEYb9KIfyRMmgY5ibXXrU",
		"metaDataUrl": "https://owncloud.localhost:8443/.well-known/openid-configuration",
		"url": "https://owncloud.localhost:8443"
	},
	"apps" : [
		"files", "markdown-editor","pdf-viewer"
	]
}

The config requires some cleanup .....

This only replaces the used library. Implicit grant still used with OAuth when talking to ownCloud.
The OpenId Connect flow already uses Auth Code and refreshing the token works.

Related Issue

How Has This Been Tested?

  • ✋

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

Open tasks:

  • Add PKCE support
  • Cleanup config settings in config.json

@DeepDiver1975 DeepDiver1975 self-assigned this Jan 21, 2019
@DeepDiver1975 DeepDiver1975 added the Status:Needs-Review Needs review from a maintainer label Jan 21, 2019
@DeepDiver1975 DeepDiver1975 added this to the Current: Sprint 2 milestone Jan 21, 2019
@DeepDiver1975
DeepDiver1975 force-pushed the feature/openid-connect-lib branch 4 times, most recently from 409b3d9 to e5d0d09 Compare January 22, 2019 15:05
@scramb

scramb commented Jan 24, 2019

Copy link
Copy Markdown
Contributor

Got some issues login in... Is there anything i need to change in config?
2019-01-24-151821_942x964_scrot
2019-01-24-151736_951x126_scrot

@DeepDiver1975

Copy link
Copy Markdown
Contributor Author

Got some issues login in... Is there anything i need to change in config?

I'll add some notes in the description asap ....

@DeepDiver1975
DeepDiver1975 force-pushed the feature/openid-connect-lib branch from b5f178d to 0262735 Compare January 24, 2019 14:30
@butonic

butonic commented Jan 24, 2019

Copy link
Copy Markdown
Contributor

hm auth.js takes window.location.origin as basis for the callback, but that will take kerio as the base url ... an my case https://owncloud.localhost:8443/ but I need https://owncloud.localhost:8443/phoenix/ ... If I hardcode that it works fine.

@DeepDiver1975

Copy link
Copy Markdown
Contributor Author

kerio

❓

@DeepDiver1975

Copy link
Copy Markdown
Contributor Author

hm auth.js takes window.location.origin as basis for the callback, but that will take kerio as the base url ... an my case https://owncloud.localhost:8443/ but I need https://owncloud.localhost:8443/phoenix/ ... If I hardcode that it works fine.

Thx for testing - I'll have a look asap ...

@DeepDiver1975
DeepDiver1975 force-pushed the feature/openid-connect-lib branch from 0262735 to 6c2fec9 Compare January 24, 2019 16:09
@CLAassistant

CLAassistant commented Jan 24, 2019 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@DeepDiver1975

Copy link
Copy Markdown
Contributor Author

@butonic mind testing this commit? 76e57b8 - THX

@butonic

butonic commented Jan 24, 2019 •

Copy link
Copy Markdown
Contributor

@DeepDiver1975 hm, window.location.pathname may end in a /, leading to kopano connect crying about an invalid url again.

diff --git a/src/services/auth.js b/src/services/auth.js
index 84f2cca..7b4a520 100644
--- a/src/services/auth.js
+++ b/src/services/auth.js
@@ -15,13 +15,13 @@ export function initVueAuthenticate (config) {
         // with OAuth2 we need to se the metadata manually
         metadataUrl: config.metaDataUrl,
         client_id: config.clientId,
-        redirect_uri: baseUrl + '/#/oidc-callback',
+        redirect_uri: baseUrl + '#/oidc-callback',
         response_type: 'code', // code triggers auth code grant flow
         response_mode: 'query',
         scope: 'openid profile offline_access',
         monitorSession: false,
         post_logout_redirect_uri: baseUrl,
-        silent_redirect_uri: baseUrl + '/#/oidc-silent-redirect',
+        silent_redirect_uri: baseUrl + '#/oidc-silent-redirect',
         accessTokenExpiringNotificationTime: 10,
         automaticSilentRenew: false,
         filterProtocolClaims: true,

fixes that for me

@DeepDiver1975
DeepDiver1975 force-pushed the feature/openid-connect-lib branch from bcc9ca4 to 4b366b1 Compare January 25, 2019 08:43
@scramb
scramb force-pushed the feature/openid-connect-lib branch from 2e90455 to b21d6f9 Compare January 29, 2019 17:32

@scramb scramb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to work smoother than the old lib. Can't get the test to run by just bumping 🤓

@scramb
scramb merged commit 5b12d65 into master Jan 29, 2019
@delete-merged-branch
delete-merged-branch Bot deleted the feature/openid-connect-lib branch January 29, 2019 18:01
AlexAndBear pushed a commit to AlexAndBear/web that referenced this pull request May 12, 2025
…ta-streams-archive-download

fix: use native fetch for downloading archives
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Status:Needs-Review Needs review from a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants