Coder Social home page Coder Social logo

Comments (16)

Mmx233 avatar Mmx233 commented on August 17, 2024

enc 可能在网页的 query 中。Products is not found 可能是你的 usertype 或者登录地址不正确,有的学校宿舍网络和免费教育网络认证地址不一样,混用就会出现 Products is not found

from bitsrunlogingo.

Mmx233 avatar Mmx233 commented on August 17, 2024

如果哪里都找不到 enc 的话,我建议你将其置为空字符串

from bitsrunlogingo.

ramondsq avatar ramondsq commented on August 17, 2024

如果哪里都找不到 enc 的话,我建议你将其置为空字符串

info 参数前面几个字符是 SRBX1 ,应该是对应 enc 参数的 srun_bx1 ?
image

from bitsrunlogingo.

Mmx233 avatar Mmx233 commented on August 17, 2024

程序中是固定的 SRBX1,我目前没见过有别的值,所以不清楚这个前缀具体意味着什么

from bitsrunlogingo.

ramondsq avatar ramondsq commented on August 17, 2024

如果哪里都找不到 enc 的话,我建议你将其置为空字符串

尝试了把 enc 参数设置为空字符串,依旧是错误信息 E2806: Products is not found (39).

另外就是注意到登录成功后 rad_user_info 里包含了 product 相关信息,不知道是否有用

image

from bitsrunlogingo.

Mmx233 avatar Mmx233 commented on August 17, 2024

从你给的图片中的信息可以看出 usertype 的值是正确的,但是无法判断登录失败的原因。新的 release 1.4.5 中添加了 4 个新的可配置字段,我不确定这是否能解决你的问题,但你可以试试调整他们

from bitsrunlogingo.

Mmx233 avatar Mmx233 commented on August 17, 2024

我发现我不小心忽略了控制台的截图,你的配置确实没有问题。要找出问题在哪需要一些深入的研究

from bitsrunlogingo.

ramondsq avatar ramondsq commented on August 17, 2024

从你给的图片中的信息可以看出 usertype 的值是正确的,但是无法判断登录失败的原因。新的 release 1.4.5 中添加了 4 个新的可配置字段,我不确定这是否能解决你的问题,但你可以试试调整他们

试了一下 release 1.4.5 ,enc 参数无论是默认值还是空值依旧是相同的错误 E2806: Products is not found (39).

Condig.yaml

image

log

2023-12-01 09:56:05 [INFO] 正在获取登录状态
2023-12-01 09:56:05 [DEBU] HTTP GET  http://172.16.245.50/cgi-bin/rad_user_info
2023-12-01 09:56:05 [DEBU] jQuery1701395765127808000({"client_ip":"10.30.49.213","ecode":0,"error":"not_online_error","error_msg":"","online_ip":"10.30.49.213","res":"not_online_error","srun_ver":"SRunCGIAuthIntfSvr V1.18 B20211028","st":1701395765})
2023-12-01 09:56:05 [DEBU] 认证客户端 ip:  10.30.49.213
2023-12-01 09:56:05 [INFO] 检测到用户未登录,开始尝试登录...
2023-12-01 09:56:05 [DEBU] 正在获取 Token
2023-12-01 09:56:05 [DEBU] HTTP GET  http://172.16.245.50/cgi-bin/get_challenge
2023-12-01 09:56:05 [DEBU] jQuery1701395765143987000({"challenge":"fc2d515883d0ab14e00eea07f3a358f27b76b2679aec72f14f32f20f21f74341","client_ip":"10.30.49.213","ecode":0,"error":"ok","error_msg":"","expire":"35","online_ip":"10.30.49.213","res":"ok","srun_ver":"SRunCGIAuthIntfSvr V1.18 B20211028","st":1701395765})
2023-12-01 09:56:05 [DEBU] token:  fc2d515883d0ab14e00eea07f3a358f27b76b2679aec72f14f32f20f21f74341
2023-12-01 09:56:05 [DEBU] 发送登录请求
2023-12-01 09:56:05 [DEBU] HTTP GET  http://172.16.245.50/cgi-bin/srun_portal
2023-12-01 09:56:05 [DEBU] jQuery1701395765150509000({"client_ip":"10.30.49.213","ecode":"E2806","error":"login_error","error_msg":"E2806: Products is not found (39).","online_ip":"10.30.49.213","res":"login_error","srun_ver":"SRunCGIAuthIntfSvr V1.18 B20211028","st":1701395765})
2023-12-01 09:56:05 [ERRO] 登录出错:  login_error

以下是网页实现登陆逻辑的相关 js 文件,不知道是否有帮助。在此还是非常感谢 Mmx233 的帮助
jquery.srun.portal.js: https://pastebin.ubuntu.com/p/FRgz4N8Mwq/
main.js: https://pastebin.ubuntu.com/p/89vws8rYSv/

from bitsrunlogingo.

Mmx233 avatar Mmx233 commented on August 17, 2024

我对比了你的 jquery.srun.portal.js,除了多了一段 OAuth 以及一些显示方面的区别之外没有差异

你在正常登录时有对路径 /v1/srun_portal_oauth 的请求吗

    /**
     * oauth2 协议登录
     * Url:/v1/srun_portal_oauth
     */
    function oauth(url, params, callback) {
        $.get(autoBuildUrl(url) + "/v1/srun_portal_oauth" + params, callback);
    }

    /**
     * oauth Auth
     */
    $.OAuth = function (url, data, callback) {
        var urlParams = location.search;

        var ssoCallback = function (response) {
            if (response.Code === 200) {
                return callback({
                    error: 200,
                    message: "OK",
                    ac_id: response.ID
                });
            } else if (response.Code === 301) {
                location.href = response.Redirect
            }

            var message = error(0, response.Message);
            return callback({
                error: "fail",
                code: response.Code,
                redirect: response.Redirect,
                message: message
            });
        };
        oauth(url, urlParams, ssoCallback)
    };

    /**
     * double auth
     * Url: /v1/srun_portal_double
     */
    function ddiDoubleAuth(url, params, callback) {
        $.get(autoBuildUrl(url) + "/v1/srun_portal_double" + params, callback);
    }

    $.DdiDoubleAuth = function (url, callback) {
        var ddiCallback = function (response) {
            return callback({
                code: response.code,
                message: response.message
            })
        };
        ddiDoubleAuth(url, location.search, ddiCallback)
    };

from bitsrunlogingo.

Mmx233 avatar Mmx233 commented on August 17, 2024

根据你的 jquery.srun.portal.js,你的 enc 是 srun_bx1,enc 会影响 info 字段的编码结果

var enc = "s" + "run" + "_bx1", n = 200, type = 1;

from bitsrunlogingo.

ramondsq avatar ramondsq commented on August 17, 2024

我对比了你的 jquery.srun.portal.js,除了多了一段 OAuth 以及一些显示方面的区别之外没有差异

你在正常登录时有对路径 /v1/srun_portal_oauth 的请求吗

没有对 /v1/srun_portal_oauth 的请求

image

from bitsrunlogingo.

Mmx233 avatar Mmx233 commented on August 17, 2024

这样的话 srun_portal 的逻辑和表单是完全一致的,那问题是不是出在 get_challenge 这边呢,这个请求的表单是不是 callback username ip_

from bitsrunlogingo.

ramondsq avatar ramondsq commented on August 17, 2024

这样的话 srun_portal 的逻辑和表单是完全一致的,那问题是不是出在 get_challenge 这边呢,这个请求的表单是不是 callback username ip_

是的,如图

Snipaste_2023-12-01_16-15-50

from bitsrunlogingo.

Mmx233 avatar Mmx233 commented on August 17, 2024

我找到问题了,示例配置文件和实际配置文件不一致,你需要将 userType 的 T 大写或者使用程序自动自动生成的配置文件填写配置

from bitsrunlogingo.

Mmx233 avatar Mmx233 commented on August 17, 2024

新的 release 中修正这个字段为 user_type 并修复了一个 bug

from bitsrunlogingo.

ramondsq avatar ramondsq commented on August 17, 2024

可以成功登陆了,感谢作者 Mmx233 帮助排查问题,配置如图,坐标 SWPU

Snipaste_2023-12-01_16-36-02

Snipaste_2023-12-01_16-36-49

from bitsrunlogingo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.