CN111010403A - Method and device for automatically generating SASL authentication file and computer storage medium - Google Patents

Method and device for automatically generating SASL authentication file and computer storage medium Download PDF

Info

Publication number
CN111010403A
CN111010403A CN201911367880.5A CN201911367880A CN111010403A CN 111010403 A CN111010403 A CN 111010403A CN 201911367880 A CN201911367880 A CN 201911367880A CN 111010403 A CN111010403 A CN 111010403A
Authority
CN
China
Prior art keywords
file
jass
user
server
client
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911367880.5A
Other languages
Chinese (zh)
Inventor
王爽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Unicloud Nanjing Digital Technology Co Ltd
Original Assignee
Unicloud Nanjing Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Unicloud Nanjing Digital Technology Co Ltd filed Critical Unicloud Nanjing Digital Technology Co Ltd
Priority to CN201911367880.5A priority Critical patent/CN111010403A/en
Publication of CN111010403A publication Critical patent/CN111010403A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/22Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks comprising specially adapted graphical user interfaces [GUI]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/083Network architectures or network communication protocols for network security for authentication of entities using passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]

Abstract

A method, apparatus, and computer storage medium for automatically generating a SASL authentication file. The method comprises the steps of receiving a request for creating the SASL file sent by a user, wherein the request comprises a user name and a password; generating a jass file of a server side and a jass file of a client side according to the request; and returning the download addresses corresponding to the jass files of the server and the client to the user. The scheme replaces the process of manually making jaas files, the jaas files are input through a visual friendly user interface, then the server automatically replaces the user name and password part in the template through the jaas file template, and finally the jaas files of the Kafka server part and the jaas files of the Kafka client part are generated. The scheme also greatly reduces the error rate of generating the jaas files.

Description

Method and device for automatically generating SASL authentication file and computer storage medium
Technical Field
The invention belongs to the field of computers, and particularly relates to a method, a device and a computer readable storage medium.
Background
The full name of SASL, Simple Authentication and Security Layer, is a mechanism to extend the C/S mode verification capability. Kafka is a distributed, partitioned, multi-replica, multi-subscriber, zookeeper-based coordinated distributed logging system that can be commonly used for web/nginx logs, access logs, message services, and the like. The SASL is a user authentication mode supported by Kafka, and requires that a server and a client jointly set a related jaas file and modify a configuration file of the Kafka server and a configuration file of the client. What is meant here is the preparation of jaas documents, which mostly is written manually by Kafka users.
The existing authentication mode needs to manually write jaas files of a server end and a client end, and errors are easy to occur; and the efficiency of manually generating jaas files is low when the Kafka cluster is created in a large batch.
Disclosure of Invention
In view of the above-mentioned deficiencies of the prior art, it is an object of the present invention to improve the accuracy and efficiency of user authentication when creating kafka clusters.
The embodiment of the invention discloses a method for automatically generating an SASL authentication file, which is characterized by receiving a request for creating the SASL file sent by a user, wherein the request comprises a user name and a password; generating a jass file of a server side and a jass file of a client side according to the request; and returning the download addresses corresponding to the jass files of the server and the client to the user.
In a possible embodiment, the generating of the jass file of the server and the jass file of the client according to the request includes presetting a jass file template of the server and a jass file template of the client; and replacing the user name and the password in the file template with the user name and the password in the request to generate a jass file of the server and a jass file of the client.
In a possible embodiment, before receiving a request sent by a user to create the SASL file, the method further includes obtaining, through a user interface, a user name and a password input by the user.
An apparatus for automatically generating a SASL authentication file, comprising: the system comprises a receiving module, a sending module and a sending module, wherein the receiving module is used for receiving a request for creating the SASL file sent by a user, and the request comprises a user name and a password; the generating module is used for generating a jass file of the server side and a jass file of the client side according to the request; and the sending module is used for returning the download addresses corresponding to the jass files of the server and the client to the user.
In a possible embodiment, the generating module further includes a preprocessing unit, configured to preset a jass file template of the server and a jass file template of the client; and the replacing unit is used for replacing the user name and the password in the file template with the user name and the password in the request to generate a jass file of the server side and a jass file of the client side.
In a possible embodiment, the receiving module is further configured to obtain, through the user interface, a user name and a password input by the user.
The invention also discloses a computer readable storage medium, which stores a computer program, and the computer program realizes any one of the above methods for automatically generating the SASL authentication file when being executed by a processor.
The invention has the beneficial effects that: the scheme replaces the process of manually making jaas files, the jaas files are input through a visual friendly user interface, then the server automatically replaces the user name and password part in the template through the jaas file template, and finally the jaas files of the Kafka server part and the jaas files of the Kafka client part are generated. The process for generating the whole jaas file is program-controlled, so that the error rate of generating the jaas file is greatly reduced. The Kafka cluster scene based on the SASL authentication is well suitable for batch creation, and the public cloud Kafka product is used for providing a user with a scene of custom starting the SASL authentication.
Drawings
FIG. 1 is a flow chart of a method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
Detailed Description
In order to facilitate understanding of those skilled in the art, the present invention will be further described with reference to the following examples and drawings, which are not intended to limit the present invention.
A messaging system is responsible for passing data from one application to another, and applications need only be concerned with the data, not with how the data is passed between two or more applications. Distributed messaging is based on reliable message queues, asynchronously delivering messages between client applications and a messaging system. Most messaging systems use a publish-subscribe model. Kafka is a publish-subscribe schema.
In a publish-subscribe messaging system, messages are persisted into a topic. The consumers can subscribe one or more topics, the consumers can consume all data in the topics, the same data can be consumed by a plurality of consumers, and the data cannot be immediately deleted after being consumed. In a publish-subscribe messaging system, the producer of a message is called a publisher and the consumer is called a subscriber. Each message issued to the Kafka cluster has a category, which is called Topic.
The SASL is a user authentication method supported by Kafka, and client and server authentication can be performed through the SASL.
The embodiment of the invention discloses a method for automatically generating an SASL authentication file, which is suitable for a Kafka cluster scene based on an SASL mechanism, and as shown in figure 1, the method comprises the following steps:
s101, receiving a request for creating the SASL file sent by a user, wherein the request comprises a user name and a password.
The method also comprises the step of acquiring a user name and a password input by a user through a user interface before receiving a request for creating the SASL file sent by the user. Specifically, a user interface UI which can be directly operated by a user is created at a client, the user can input a user name and a password through the UI, and sends a request for creating the SASL file to a server, and the server receives the request.
And S102, generating a jass file of the server side and a jass file of the client side according to the request.
The method for generating the jass files of the server and the client comprises the following steps: presetting a jass file template of a server side and a jass file template of a client side; and replacing the user name and the password in the file template with the user name and the password in the request to generate a jass file of the server and a jass file of the client.
Specifically, the server side sets a jaas file template of the Kafka server side and a jaas file template of the client side, and then generates a jaas file of the Kafka server side and a jaas file of the Kafka client side respectively according to request parameters of creating the SASL file through the UI.
S103, returning the download addresses corresponding to the jass files of the server and the client to the user.
And returning the download address of the corresponding file to the UI page, wherein the user can take the download address on the page and then respectively download the jaas file of the Kafka server and the jaas file of the Kafka client. To facilitate configuration at the Kafka server and at the Kafka client.
Through the technical scheme, the user can input the user name and the password for SASL authentication in a self-defined mode on the page. The scheme replaces the process of manually making jaas files, the jaas files are input through a visual friendly user interface, then the server automatically replaces the user name and password part in the template through the jaas file template, and finally the jaas files of the Kafka server part and the jaas files of the Kafka client part are generated. The process for generating the whole jaas file is program-controlled, so that the error rate of generating the jaas file is greatly reduced. The method is very suitable for batch creation of the SASL authentication-based Kafka cluster scene and a public cloud Kafka product for providing a user with a scene of custom starting the SASL authentication.
The embodiment of the invention also discloses a device 10 for automatically generating the SASL authentication file, as shown in fig. 2, which comprises a receiving module 101 for receiving a request for creating the SASL file sent by a user, wherein the request comprises a user name and a password; the generating module 102 is used for generating a jass file of the server side and a jass file of the client side according to the request; and the sending module 103 is configured to return the download addresses corresponding to the jass file of the server and the jass file of the client to the user.
The generation module 102 further comprises a preprocessing unit, which is used for presetting a jass file template of the server and a jass file template of the client; and the replacing unit is used for replacing the user name and the password in the file template with the user name and the password in the request to generate a jass file of the server side and a jass file of the client side.
The receiving module 101 is further configured to obtain a user name and a password input by a user through a user interface.
For the specific implementation of the apparatus 10, reference may be made to the method embodiment, which is not described in detail.
A server comprises a processor and a memory, wherein the memory is used for storing a computer program corresponding to the method for automatically generating the SASL authentication file, and the processor is used for executing the computer program.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described embodiments are merely illustrative, and for example, a division of a unit is merely a division of a logic function, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed.
While the invention has been described in terms of its preferred embodiments, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention.

Claims (8)

1. A method for automatically generating an SASL authentication file, comprising: receiving a request for creating a SASL file sent by a user, wherein the request comprises a user name and a password; generating a jass file of a server side and a jass file of a client side according to the request; and returning the download addresses corresponding to the jass files of the server and the client to the user.
2. The method according to claim 1, wherein the generating of the server-side jass file and the client-side jass file according to the request comprises presetting a server-side jass file template and a client-side jass file template; and replacing the user name and the password in the file template with the user name and the password in the request to generate a jass file of the server and a jass file of the client.
3. The method of claim 1, further comprising, prior to receiving a request from a user to create a SASL file, obtaining a user name and password entered by the user via a user interface.
4. An apparatus for automatically generating a SASL authentication file, comprising: the system comprises a receiving module, a sending module and a sending module, wherein the receiving module is used for receiving a request for creating the SASL file sent by a user, and the request comprises a user name and a password; the generating module is used for generating a jass file of the server side and a jass file of the client side according to the request; and the sending module is used for returning the download addresses corresponding to the jass files of the server and the client to the user.
5. The apparatus according to claim 4, wherein the generating module further comprises a preprocessing unit, configured to preset a jass file template of the server and a jass file template of the client; and the replacing unit is used for replacing the user name and the password in the file template with the user name and the password in the request to generate a jass file of the server side and a jass file of the client side.
6. The apparatus of claim 4, wherein the receiving module is further configured to obtain a user name and a password entered by a user through a user interface.
7. A computer storage medium having stored thereon a computer program which, when executed by a processor, implements a method of automatically generating a SASL authentication file as claimed in any of claims 1 to 3.
8. A server comprising a processor and a memory, wherein the memory is used for storing a computer program corresponding to the method for automatically generating a SASL certification file according to any one of claims 1-3, and the processor is used for executing the computer program.
CN201911367880.5A 2019-12-26 2019-12-26 Method and device for automatically generating SASL authentication file and computer storage medium Pending CN111010403A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911367880.5A CN111010403A (en) 2019-12-26 2019-12-26 Method and device for automatically generating SASL authentication file and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911367880.5A CN111010403A (en) 2019-12-26 2019-12-26 Method and device for automatically generating SASL authentication file and computer storage medium

Publications (1)

Publication Number Publication Date
CN111010403A true CN111010403A (en) 2020-04-14

Family

ID=70118888

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911367880.5A Pending CN111010403A (en) 2019-12-26 2019-12-26 Method and device for automatically generating SASL authentication file and computer storage medium

Country Status (1)

Country Link
CN (1) CN111010403A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050005090A1 (en) * 2003-07-01 2005-01-06 International Business Machines Corporation Method and system for dynamic client authentication in support of JAAS programming model
US20120254969A1 (en) * 2011-03-28 2012-10-04 Canon Kabushiki Kaisha Systems and methods for implementing security services
CN103841117A (en) * 2014-03-21 2014-06-04 北京京东尚科信息技术有限公司 JAAS login method and server based on Cookie mechanism
CN104834558A (en) * 2015-05-19 2015-08-12 北京京东尚科信息技术有限公司 Method and system for processing data
CN105760168A (en) * 2016-02-23 2016-07-13 深圳竹信科技有限公司 Automatic code file generation method and system
CN106341233A (en) * 2015-07-08 2017-01-18 阿里巴巴集团控股有限公司 Authentication method for client to log into server, device, system and electronic device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050005090A1 (en) * 2003-07-01 2005-01-06 International Business Machines Corporation Method and system for dynamic client authentication in support of JAAS programming model
US20120254969A1 (en) * 2011-03-28 2012-10-04 Canon Kabushiki Kaisha Systems and methods for implementing security services
CN103841117A (en) * 2014-03-21 2014-06-04 北京京东尚科信息技术有限公司 JAAS login method and server based on Cookie mechanism
CN104834558A (en) * 2015-05-19 2015-08-12 北京京东尚科信息技术有限公司 Method and system for processing data
CN106341233A (en) * 2015-07-08 2017-01-18 阿里巴巴集团控股有限公司 Authentication method for client to log into server, device, system and electronic device
CN105760168A (en) * 2016-02-23 2016-07-13 深圳竹信科技有限公司 Automatic code file generation method and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
CSDN: "Kafka JAAS Plain SASL安全认证配置", 《HTTPS://BLOG.CSDN.NET/GETING/ARTICLE/DETAILS/52044055?SPM=1001.2014.3001.5501》 *

Similar Documents

Publication Publication Date Title
CN108521858B (en) Device identifier dependent handling of operations for packet-based data communication
US20130346491A1 (en) Server-Based Data Sharing in Computer Applications Using A Clipboard
US20130080545A1 (en) Automatic access settings based on email recipients
CN110941500B (en) Interface display method and device
US8489694B2 (en) Peer-to-peer collaboration of publishers in a publish-subscription environment
CN103095684B (en) Obtain and pay close attention to the method for user's aggregation information, Apparatus and system
WO2019080460A1 (en) Management method for official wechat account, electronic device and computer-readable storage medium
CN114363407B (en) Message service method and device, readable storage medium and electronic equipment
CN104462534A (en) Network information sharing method and device
US9396448B2 (en) Distributed and open schema interactions management system and method
US20110219083A1 (en) Email auto-filing and management
CN101465817A (en) Method, server and system for transmitting network community message
CN106874315A (en) For providing the method and apparatus to the access of content resource
CN110868322B (en) Network management method, system, device and storage medium for distributed message service
CN107357588B (en) Object code generation method and device
CN104094299A (en) Retrieving availability information from published calendars
CN111193661B (en) Management method and device based on enterprise communication channel fusion system
TW201908999A (en) Signature file generation method, signature file template sharing method and device
WO2020258687A1 (en) Message reply management method and system
CN115757642A (en) Data synchronization method and device based on filing log file
CN111010403A (en) Method and device for automatically generating SASL authentication file and computer storage medium
CN106843971A (en) BIOS method for refreshing, server, BMC, medium and storage control
WO2014063547A1 (en) Method, device and system for automatically prompting user to register microblog
CN103092932A (en) Distributed document transcoding system
CN110163564A (en) Method, system and the storage medium of item service are generated based on item model

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20200414

RJ01 Rejection of invention patent application after publication