如何将用户名(APP_USER)设置为APEX中单点登录的电子邮件? [英] How do you set the username (APP_USER) as the email from single-sign on in APEX?

查看:254
本文介绍了如何将用户名(APP_USER)设置为APEX中单点登录的电子邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用本教程,该应用现在允许登录.但是,APP_USER的值不等于通过Microsoft登录的电子邮件地址-默认为APEX_PUBLIC_USER.我想使用用户名提供基于角色的应用程序访问控制.

I'm setting up an APEX app using single-sign on following this tutorial and the app now allows sign-in to occur. However the value of APP_USER does not equal the email address that is logged in through Microsoft - it defaults to APEX_PUBLIC_USER. I want to use the username to provide role-based application access control.

我到处寻找解决方案,发现发布身份验证代码,看起来应该会有所帮助,我已尝试适应.

I've looked around for solutions and found post authentication code that looks like it should help and I have tried to adapt.

使用

procedure post_authenticate
is
begin
    w14_auth_pkh.post_authenticate(
        p_username => :APP_USER);
end post_authenticate

apex_custom_auth.set_user (p_user => :APP_USER);

从身份验证方案部分中应用更改时,我收到以下错误消息:

I get the following error messages when applying changes from within the authenticate scheme section:

ORA-06550:第8行,第1列:PLS-00103:在预期以下情况之一时遇到符号"BEGIN":符号;"被替换为"BEGIN"以继续.

ORA-06550: line 8, column 1: PLS-00103: Encountered the symbol "BEGIN" when expecting one of the following: ; The symbol ";" was substituted for "BEGIN" to continue.

ORA-06550:第2行,第17列:PLS-00103:遇到符号".当期望以下内容之一时:常量异常表列long double ref char time timestamp interval date二进制国家字符nchar用符号"代替".继续.

ORA-06550: line 2, column 17: PLS-00103: Encountered the symbol "." when expecting one of the following: constant exception table columns long double ref char time timestamp interval date binary national character nchar The symbol "" was substituted for "." to continue.

推荐答案

您的第一个代码示例使用了一包Dimitri's,并且最后缺少分号.

You first code sample uses a package of Dimitri's, and is missing a semi-colon at the end.

您的相关代码为 APEX_CUSTOM_AUTH.SET_USER();

Your relevant code would be APEX_CUSTOM_AUTH.SET_USER();

或者,您可以将Username属性更改为通过用户信息端点URL可用的属性.

Alternatively, you could change the Username attribute to something that has been made available via the user info endpoint URL.

这篇关于如何将用户名(APP_USER)设置为APEX中单点登录的电子邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆