Is there a way to start the authentication process via a link?

Created on 14 December 2022, almost 2 years ago
Updated 8 June 2024, 5 months ago

Problem/Motivation

I am looking to see if it is possible to create a link that would be the equivalent of clicking on the "Login with Client Name". On the login form.

I see there is a hidden option for "OpenID buttons display in user login form", but not how I would log in while they are hidden.

I've tried using the URL that is sent to the IDP but on log in, there is an error logged saying "access denied" to "openid_connect/client?code=..."

Am I missing something?

Thank you.
PK2

💬 Support request
Status

Closed: works as designed

Version

3.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇳🇴Norway steinmb

    I guess this is an support req.

  • @steinmb - It's been a while since I looked at this, in fact, I had not realized you had replied to me until just now when I thought to check if there had been any updates to my issue.

    Is there anything I can provide to make it easier to find the cause of the issue?

    I can provide a patch that applies my fix, which has been working for us since December, but I haven't had a chance to see what is actually at fault. All my patch would do is comment out the logic that was preventing it from working for us.

  • 🇳🇴Norway steinmb

    Thank you for getting back to "us". I am not a maintainer though, feel free to attach a patch, and if this turn into a missing feature we could rescope this into a feature request.

  • 🇻🇳Vietnam tannguyenhn

    @pumpkinkid2

    I think you can do it by create a custom controller to call client authorize and set the give response like this.
    https://git.drupalcode.org/project/openid_connect/-/merge_requests/27/diffs

  • 🇨🇦Canada liquidcms

    Been tasked to do the same thing (have a link to initiate authentication). I was thinking custom controller would be involved. Looking at the MR in #6 i don't see a controller though, am i missing something?

  • 🇨🇦Canada liquidcms

    Ah, perhaps just triggering off /user/login? Trying it out now.

  • 🇨🇦Canada liquidcms

    Tried event subscriber in a custom module and works great. Thanks for this.

  • @tannguyenhn - Thank you for your reply, I will look into this and see if this will help alleviate other issues we are having.

    I was able to figure out how to start the process with an unmodified version of the module by calling the link in a specific way. It seems that I was just not understanding how the module was designed to accommodate for this use case.

    I ended up having to add the domain to Allowed domains in the configuration, as I had suspected, however, the link had to be called as so:
    /openid-connect//initiate?iss=https://www.domain.com

  • Status changed to Needs review 5 months ago
  • 🇧🇪Belgium Thomas Cys

    The initiate link works but it ignores the scopes defined by the openid connect client. It only uses the default scopes (email, openid). The attached patch fixes this bug.

  • Status changed to Closed: works as designed 5 months ago
Production build 0.71.5 2024