Pro Spring Security: Securing Spring Framework 6 and Boot 3–based Java Applications, Third Edition Massimo Nardone pdf download
Pro Spring Security: Securing Spring Framework 6 and Boot 3–based Java Applications, Third Edition Massimo Nardone pdf download
https://ebookmass.com/product/pro-spring-security-securing-
spring-framework-6-and-boot-3-based-java-applications-third-
edition-massimo-nardone/
https://ebookmass.com/product/beginning-spring-data-data-access-and-
persistence-for-spring-framework-6-and-boot-3-andres-sacco/
https://ebookmass.com/product/pro-spring-6-an-in-depth-guide-to-the-
spring-framework-6th-edition-iuliana-cosmina/
Pro Spring 6 with Kotlin: An In-depth Guide to Using
Kotlin APIs in Spring Framework 6 1st Edition Peter Späth
https://ebookmass.com/product/pro-spring-6-with-kotlin-an-in-depth-
guide-to-using-kotlin-apis-in-spring-framework-6-1st-edition-peter-
spath/
https://ebookmass.com/product/spring-6-recipes-a-problem-solution-
approach-to-spring-framework-marten-deinum/
https://ebookmass.com/product/hacking-with-spring-boot-2-3-reactive-
edition/
https://ebookmass.com/product/learn-microservices-with-spring-
boot-3-3rd-converted-edition-moises-macero-garcia/
Pro Spring Security
Securing Spring Framework 6
and Boot 3-based Java Applications
Third Edition
Massimo Nardone
Carlo Scarioni
Pro Spring Security: Securing Spring Framework 6 and Boot 3–based Java
Applications, Third Edition
Massimo Nardone Carlo Scarioni
HELSINKI, Finland Surbiton, UK
Introduction�������������������������������������������������������������������������������������������������������������xv
v
Table of Contents
Core Container����������������������������������������������������������������������������������������������������������������������� 30
Data Access and Transactions����������������������������������������������������������������������������������������������� 31
Spring Messaging������������������������������������������������������������������������������������������������������������������ 32
General Web Revision������������������������������������������������������������������������������������������������������������ 32
Spring MVC���������������������������������������������������������������������������������������������������������������������������� 32
Spring WebFlux���������������������������������������������������������������������������������������������������������������������� 32
Observability�������������������������������������������������������������������������������������������������������������������������� 33
Pattern Matching������������������������������������������������������������������������������������������������������������������� 33
Testing����������������������������������������������������������������������������������������������������������������������������������� 34
Dependency Injection������������������������������������������������������������������������������������������������������������ 34
Aspect-Oriented Programming���������������������������������������������������������������������������������������������� 36
What’s New in Spring Security 6?����������������������������������������������������������������������������������������������� 38
Summary������������������������������������������������������������������������������������������������������������������������������������ 44
Chapter 8: Open Authorization 2.0 (OAuth 2.0) and Spring Security�������������������� 211
An Introduction to OAuth 2.0����������������������������������������������������������������������������������������������������� 211
OAuth 2.0 Security��������������������������������������������������������������������������������������������������������������� 213
Integrating OAuth 2.0 with Spring Security������������������������������������������������������������������������� 214
OAuth 2.0 Login������������������������������������������������������������������������������������������������������������������� 217
Summary���������������������������������������������������������������������������������������������������������������������������������� 238
vii
Table of Contents
Index��������������������������������������������������������������������������������������������������������������������� 281
viii
About the Authors
Massimo Nardone has more than 27 years of experience
in information and cybersecurity for IT/OT/IoT/IIoT,
web/mobile development, cloud, and IT architecture. His
true IT passions are security and Android. He has been
programming and teaching how to program with Android,
Perl, PHP, Java, VB, Python, C/C++, and MySQL for more
than 27 years. He holds an MSc degree in computing
science from the University of Salerno, Italy. Throughout
his working career, he has held various positions, starting
as a programming developer, then security teacher, PCI
QSA, auditor, assessor, lead IT/OT/SCADA/SCADA/
cloud architect, CISO, BISO, executive, program director, and OT/IoT/IIoT security
competence leader.
In his last working engagement, he worked as a seasoned cyber and information
security executive, CISO and OT, IoT and IIoT Security competence Leader, helping
many clients to develop and implement Cyber, Information, OT, and IoT security
activities.
His technical skills include security, OT/IoT/IIoT, Android, cloud, Java, MySQL,
Drupal, Cobol, Perl, web and mobile development, MongoDB, D3, Joomla!, Couchbase,
C/C++, WebGL, Python, Pro Rails, Django CMS, Jekyll, and Scratch. He has served as a
visiting lecturer and exercises supervisor at the Helsinki University of Technology (Aalto
University) Networking Laboratory.
He stays current with industry and security trends and is a board member of the
ISACA Finland chapter, ISF, the Nordic CISO Forum, and the Android Global Forum.
He holds four international patents (PKI, SIP, SAML, and Proxy areas). He currently
works as a cybersecurity freelancer for IT/OT and IoT. Massimo has reviewed more than
55 IT books for different publishers and has coauthored Pro JPA 2 in Java EE 8 (Apress,
2018), Beginning EJB in Java EE 8 (Apress, 2018), and Pro Android Games (Apress, 2015).
ix
About the Authors
x
About the Technical Reviewer
Mario Faliero is a telecommunication engineer and
entrepreneur. He has more than ten years of experience in
radio frequency hardware engineering. Mario has extensive
experience in numerical coding, using scripting languages
(MatLab, Python) and compiled languages (C/C++, Java).
He has been responsible for developing electromagnetic
assessment tools for space and commercial applications.
Mario received his master’s degree from the University
of Siena.
xi
Acknowledgments
Many thanks go to my wonderful family for supporting me while I was working on this
book. Luna, Leo, and Neve, you are the most beautiful reason of my life.
I want to thank my beloved late mother, Maria Augusta Ciniglio, who always
supported and loved me so much. I will love and miss you forever, my dearest mom.
Thanks to my beloved father, Giuseppe, and my brothers, Mario and Roberto, for
your endless love and for being the best dad and brothers in the world.
Many thanks to Melissa Duffy for giving me the opportunity to work as a writer on
this book, Shonmirin P. A. for doing such a great job during the editorial process and
supporting me, and Laura Berendson, development editor, for helping me to make it a
better book.
—Massimo Nardone
xiii
Introduction
Denying the impact of the Spring Framework in the Java world would be simply
impossible. Spring has brought so many advantages to Java developers that we could say
it has made us all better developers.
The previous version of this book utilized Spring Security 5. Therefore, in this new
edition of the book, it is very important to note the most important changes from version
5 to version 6.
Spring Framework 6.0 was released on November 16, 2022. It came with a Java
17+ baseline and a move to Jakarta EE 9+ (in the Jakarta namespace), focusing on
the recently released Jakarta EE 10 APIs such as Servlet 6.0 and JPA 3.1. Spring’s
current version’s core building blocks of dependency injection and aspect-oriented
programming widely apply to many business and infrastructure concerns. Certainly,
application security can benefit from these core functionalities. Even in version 6, Spring
Security is an application-level security framework built on top of the powerful Spring
Framework that deals mainly with the core security concepts of authentication and
authorization, which, also in version 6, are some of the fundamental functionalities of
Spring Security.
Spring Security aims to be a full-featured security solution for your Java applications.
Although its focus is on web applications and the Java programming language, you will
see that it goes beyond these two domains.
Because there are new things in the version, the baseline for Spring Boot 3 and
Spring Security 6 is Java 17.
Also, the WebSecurityConfigurerAdapter class to configure security settings was
deprecated in version 6, using a more component-based approach and creating a bean
of type SecurityFilterChain.
AuthorizeRequests was also deprecated and replaced with authorizeHttpRequests,
and in Spring Security 6, AntMatcher, MvcMatcher, and RegexMatcher were deprecated
and replaced by requestMatchers or securityMatchers for path-based access control.
Also, in version 6, some updates were done using OAuth 2.0 and SAML 2.0.
xv
Introduction
In writing this book, we wanted to expose some of Spring Security’s internal works
along with standard explanations of how to use certain features. The idea is to teach
beyond the basics of how to do something in particular and instead focus on the
plumbing inside the framework. This is the best way to learn something: seeing how it
is built in the core. That’s not to say that the book doesn’t cover basic setups and gives
quick, practical advice on using the framework because it certainly does. The point is
that instead of saying, “Use this to do that,” we say, “This works like this… and this allows
you to….” This is a point of view that only tools like Spring can afford (because they are
open source).
With that said, we suggest that the best way to use this book is to have the Spring
Security source code checked out on your computer and go through the examples
with both the code from the book and the code from Spring Security itself. This will
help you understand each concept as it is introduced and teach more than one good
programming trick and good practice. We recommend this approach for studying
any software whenever you have the chance. If the source code is out there, grab it.
Sometimes, a couple of lines of code teach more than a thousand words. This book
primarily introduces Spring Boot 3, analyzes Spring Framework, and develops Java web
applications with Spring Security 6 and Java 17/20.
Also, Spring Security 6 supports many different authentication mechanisms, which
are introduced and developed in this book, including the H2 and PostgreSQL databases,
LDAP, X.509, OAuth 2.0, JWT, JAAS, and CAS.
xvi
Introduction
• Chapter 2 introduces Spring Security 6, how to use it, when to use it,
and its security functionalities.
xvii
Introduction
Prerequisites
The examples in this book are all built with Java 17 and Maven 3.9.2. The latest Spring
versions are used if possible. Spring Security 6 is the version used throughout the book.
Tomcat Web Server 10 is used for the different web applications in the book, mainly
through its Maven plugin. The laptop is a ThinkPad Yoga 360 with 8 GB of RAM. All the
projects were developed using IntelliJ IDEA Ultimate 2023.2.
You are free to use your own tools and operating system. Because everything is Java-
based, you should be able to compile your programs on any platform without problems.
xviii
CHAPTER 1
1
© Massimo Nardone, Carlo Scarioni 2024
M. Nardone and C. Scarioni, Pro Spring Security, https://doi.org/10.1007/979-8-8688-0035-1_1
Chapter 1 The Scope of Security
2
Chapter 1 The Scope of Security
3
Chapter 1 The Scope of Security
The three major security layers in an IT infrastructure are the network, the operating
system (part of the endpoint security layer), and the application itself.
4
Chapter 1 The Scope of Security
This is not enough in most cases, as traffic at this level is normally allowed to enter
the publicly open ports of your various exposed services without restriction. Different
attacks can be targeted at these open services, as attackers can execute arbitrary
commands that could compromise your security constraints. Tools like the popular nmap
(http://nmap.org/) can scan a machine to find open ports. Using such tools is an easy
first step in preparing an attack because well-known attacks can be used against such
open ports if they are not properly secured.
A very important part of the network-layer security, in the case of web applications,
is the use of Secure Sockets Layer (SSL) to encode all sensitive information sent along
the wire, but this is related more to the network protocol at the application level than to
the network physical level at which firewalls operate.
5
Chapter 1 The Scope of Security
Authentication
Authentication is the process of verifying the identity of a user or entity attempting
to access an application. It ensures that the user is who they claim to be. Common
authentication methods include the following.
1
LDAP is explained in some detail in Chapter 8, where various authentication providers are
covered.
6
Chapter 1 The Scope of Security
Authorization
Authorization determines what actions or resources a user can access within an
application. Once a user is authenticated, authorization mechanisms control their
permissions based on predefined rules and policies. This ensures that users can only
access the features and data they are authorized to use. Authorization can be role-based,
attribute-based, or rule-based.
7
Chapter 1 The Scope of Security
When a user is authenticated, that only means that the user is known to the system
and has been recognized by it. It doesn’t mean that the user is free to do whatever she
wants in said system. The next logical step in securing an application is determining
which actions the user can perform and which resources she can access. If the user
doesn’t have the proper permissions, she cannot carry out that particular action. This
is the work of the authorization process. In the most common case, the authorization
process compares the user’s set of permissions against the permissions required
to execute a particular action in the application, and if a match is found, access is
granted. On the other hand, if no match is found, access is denied. Figure 1-3 shows the
authorization mechanism.
Figure 1-3. Simple authorization process: the authenticated user tries to access a
secured resource
8
Chapter 1 The Scope of Security
ACLs
An access control list (ACL) manages access rights and permissions to specific resources
or objects within an application. It is typically used in conjunction with authorization.
An ACL defines who has access to a particular resource and what actions they can
perform on that resource. It consists of a list of users or groups and their corresponding
permissions (read, write, execute, etc.) for specific resources.
ACLs are part of the authorization process explained in the previous section. The key
difference is that ACLs normally work at a finer-grained level in the application. ACLs
are a collection of mappings between resources, users, and permissions. With ACLs, you
can establish rules like “User John has administrative permission on the blog post X” or
“User Luis has read permission on blog post X.” You can see the three elements: user,
permission, and resource. Figure 1-3 shows how ACLs work; they are just a special case
of the general authorization process.
• Credentials: Credentials are the way a user proves who they are.
Normally, in the shape of passwords (certificates are also a common
way of presenting credentials), they are data that only the owner of
it knows.
9
Chapter 1 The Scope of Security
• Resource: Any part of the application you want to access that needs
to be properly secured against unauthorized access—for example, a
URL, a business method, or a particular business object.
For example, let’s suppose the requesting client encrypts a string and
sends the encrypted string to the server. The server may have access
to the original information from a previous registration process, for
example, and if it does, it can apply the same hash function. Then, it
compares the output from this hashing to the value sent by the client.
If they match, the server validates the information.
Figure 1-4 shows this scheme. Usually, the server doesn’t even need
the original data. It can simply store the hashed version and then
compare it with the incoming hash from the client.
10
Chapter 1 The Scope of Security
11
Chapter 1 The Scope of Security
Figure 1-5. Symmetric encryption: the two endpoints share the same encryption/
decryption key
12
Chapter 1 The Scope of Security
• No one else can decrypt the message because they don’t have the
receiver’s private key.
The following defines the key, speed, and use case for asymmetric or PKI encryption.
The use of encryption achieves, among other things, two other security goals.
• Confidentiality: Potentially sensitive information belonging to one
user or group of users should be accessible only to this user or group.
Encryption algorithms are the main helpers in achieving this goal.
13
Chapter 1 The Scope of Security
What to Secure
Not every part of the application requires a strong security model or any security. If, for
example, one part of your application is supposed to serve static content to everyone
interested, you can simply serve this content. There probably are no security concerns to
handle here.
Anyway, when starting to work on a new application, you should think about the
security constraints that your application will have. You should think about concerns like
those in the following list and whether they apply to your particular use case.
14
Chapter 1 The Scope of Security
15
Chapter 1 The Scope of Security
16
Chapter 1 The Scope of Security
17
Chapter 1 The Scope of Security
The JDK is divided into modules. The following modules contain security APIs.
• java.base
• java.security.jgss
• java.security.sasl
• java.smartcardio
• java.xml.crypto
• jdk.jartool
• jdk.security.auth
• jdk.security.jgss
For the entire list of Java release 20 security APIs, please refer to https://docs.
oracle.com/en/java/javase/20/security/security-api-specification1.html.
Figure 1-7 shows the Java platform security architecture and elements.
18
Chapter 1 The Scope of Security
Summary
This chapter introduced security from a general point of view down to defense-in-
depth mechanisms. It explained in a very abstract way the main concerns in IT security,
especially from an application point of view. It also briefly described the main Java APIs
that support security at different levels.
You can see that this chapter was a very quick overview of security concerns. It is
beyond the scope of this book to go any further than this on general topics, although
some of them are studied in more depth when they apply to Spring Security. This is
nothing like a comprehensive software security guide, and if you are interested in
learning more about software security in general, you should consult the specialized
literature. The next chapter introduces Spring Security.
19
CHAPTER 2
Introducing Spring
Security
In this chapter, you learn what Spring Security is and how to use it to address security
concerns about your application.
We describe what’s new in Spring Framework and Spring Security version 6. Using
Spring Security 6 with authentication and authorization is discussed in detail.
Finally, you look at the framework’s source code, how to build it, and the different
modules forming the powerful Spring Security project.
21
© Massimo Nardone, Carlo Scarioni 2024
M. Nardone and C. Scarioni, Pro Spring Security, https://doi.org/10.1007/979-8-8688-0035-1_2
Chapter 2 Introducing Spring Security
This also means that there is a lot less software for you to write,
because you are using a great amount of ready-to-use code that has
been written and tested by a large and active user community. To
a certain point, you can trust that this code works and use it with
confidence. And if it does not work, you can always fix it and send a
patch to those in charge of maintaining the project.
It is very flexible in practice. Imagine, for instance, that you offer services
exposed through RMI, the Web, JMS, and others. You could secure all
these interfaces, but maybe it’s better to secure just the business layer so
that all requests are secured when they reach this layer. Also, maybe you
don’t care about securing individual business objects, so you can omit
that module and use the functionality you need.
22
Chapter 2 Introducing Spring Security
23
Chapter 2 Introducing Spring Security
• You need to secure your domain model and allow only certain
users to access certain objects in your application. If you need fine-
grained security (that is, you need to secure on a per object, per user
basis), Spring Security offers the access control list (ACL) module,
which help you to do just that in a straightforward way.
• You want to secure your service layer the same way you secure
your URLs, and you need to add rules at the method level for
24
Chapter 2 Introducing Spring Security
• You need to hide elements in your web pages from certain users
and show them to others. View security is the first layer of security in
a secured web application. It is normally not enough for guaranteeing
security. But it is very important from a usability point of view
because it allows the application to show or hide content depending
on the user currently logged in to the system.
• Spring Security
• Spring Framework
• Spring Cloud
• Spring Data
• Spring Integration
26
Chapter 2 Introducing Spring Security
• Spring Batch
• Spring Hateoas
• Spring Amqp
• Spring Mobile
• Spring LDAP
• Spring Session
• Spring Shell
• Spring Flo
• Spring Kafka
• Spring Statemachine
• Spring Io Platform
• Spring Roo
• Spring Scala
• Spring Loaded
• Spring Xd
• Spring Social
For more information, please refer to the Spring project web page at https://
spring.io/projects.
Each of these projects is built on top of the facilities provided by the Spring
Framework itself, which is the original project that started it all. Think of Spring as the
hub of all these satellite projects, providing them with a consistent programming model
27
Chapter 2 Introducing Spring Security
and a set of established practices. The main points you see throughout the different
projects is the use of DI, XML namespace-based configuration, and AOP, which, as you
see in the next section, are the pillars upon which Spring is built. In the later versions of
Spring, annotations have become the most popular way to configure both DI and AOP
concerns.
This book introduces Spring Boot, analyzes Spring Framework, and develops Spring
Security version 6. Let’s start with Spring Boot.
28
Chapter 2 Introducing Spring Security
Java configuration for Spring Security was added to the Spring Framework in Spring
3.1 and extended to Spring Security in Spring 3.2 and is defined in a class annotated
@Configuration.
Spring Security 6 requires JDK 17 and uses the Jakarta namespace.
The project for many years now has been under the Pivotal umbrella of projects,
powered by the Spring Framework itself. But what exactly is the Spring Framework?
29
Chapter 2 Introducing Spring Security
Core Container
• First-class configuration options for virtual threads on JDK 21
30
Other documents randomly have
different content
author of the old and new covenants, and the judge of all
mankind77. He does not carry on his argument with much regularity,
and it would be difficult to give any useful analysis of it. But he
discusses, towards the end, in chapters thirty-seven, thirty-eight,
and thirty-nine, the great question of the accountability of man, and
the freedom of the will.
It will be seen by this slight sketch that the former part of the
treatise is by far the most regular; and for this sufficient reason, that
it was more completely studied and digested before it was written.
In the latter books, he adheres but imperfectly to the intention
announced in the preface, and introduces much matter which was
evidently suggested casually as he was writing, by some word or
expression he found himself using.
The work, as I have said, was written in Greek; but the greater
portion of the original has been lost. What remains has been
preserved by various authors in the form of quotations. In this way
two-thirds of [pg 040] the first book have come down to us; a few
detached fragments in the latter half of the second; considerably
larger and more numerous portions of the third; very little of the
fourth, but copious extracts from the fifth, especially near the
beginning. The whole, however, existed in the ninth century, as we
learn from the testimony of Photius79. But, although we have lost the
greater part of the original, an ancient Latin translation of the whole
work has been preserved to us. The precise antiquity of this version
we are unable to ascertain; but the closeness with which Tertullian
appears to follow it in many passages80, and in particular his making
the very same [pg 041] mistakes as the interpreter, (as for instance,
in regard to the name of the heretic Epiphanes, which they [pg 042]
have both rendered by an epithet, and others instanced by
Massuet,) almost amounts to a demonstration [pg 043] that he had
read that version. That it existed in the time of S. Augustin, is
certain, as he quotes it at least twice, almost word for word81.
The effect of this great work appears to have been decisive, for we
hear no more of any eminent person who held the Gnostic opinions.
They prevailed to a certain degree for the greater part of another
century, but they did not make head again. The name, indeed,
continued to have so great a charm, that Clement of Alexandria took
it from the heretics, and applied it to an intelligent Christian, whom
he depicts as the only true Gnostic. But the system, as a whole,
became so entirely extinct that scarce a trace of its influence
remains, except in the writings of those who had to combat it.
[pg 044]
In his opposition to the Gnostics, Irenæus had to combat a heresy;
the next circumstance which brought him forward was, a schism
which threatened to separate a portion of the Christian world from
the communion of its most influential Church. There had been a
variation in very early times, and indeed from the beginning,
between the Churches of Asia Minor, Syria, and Mesopotamia on the
one hand, and the rest of the Christian world on the other, in regard
to the keeping of Easter;—other Churches uniting in keeping Easter-
day on a Sunday, whilst the Christians of those countries kept it at
the Jewish passover, on whatever day of the week it happened to
fall82. The inconvenience had been felt in the time of S. Polycarp,
who sojourning in Rome in the time of its bishop Anicetus, they
endeavoured [pg 045] each to persuade the other to embrace the
practice he followed. But their conferences were without any other
effect than to cause both parties to agree to differ in peace83. But
Victor, who succeeded Eleutherus in the see of Rome, viewed the
matter in a different light. He had no doubt felt the inconvenience of
this diversity of practice when Blastus endeavoured to raise a schism
in Rome on this very point84. He therefore conceived the idea of
using his influence, as the bishop of the principal Church [pg 046] in
the world, to bring all Christians to one uniform rule. For this
purpose he wrote to certain85 leading bishops in Asia, requesting
them to convene synods of the neighbouring bishops, in order to
come to an agreement; which was done accordingly; and they all,
with the exception of the Churches above mentioned, wrote circular
letters to the whole catholic Church, affirming that with them the
apostolical tradition was, not to break their paschal fast until the
Sunday. Eusebius particularly mentions86 the dioceses in Gaul under
the superintendence of [pg 047] Irenæus as having agreed upon
such a synodical letter, which he asserts was in existence in his time.
So far, Victor was successful; and, probably upon the strength of the
almost universal agreement of the Churches, he appears to have
held out some threat to those of Asia Minor87, unless they thought
proper to conform to the general practice. This, however, they
absolutely refused to do; maintaining that their region abounded
with relics of apostles and martyrs, and that they preserved a
tradition purer than that of any other Church, and more consonant
with the Scriptures. This reply so incensed Victor, that he forthwith
issued letters, announcing that the Asiatic brethren were cut off from
the common unity of Christians88. Here, however, he was not
followed by those who had previously agreed with him; and Irenæus
in particular, in the name of the Christians in Gaul under his
jurisdiction, wrote both to Victor and to various other bishops89,
strongly [pg 048] pressing milder measures, and reminding the
Roman prelate of the example of Anicetus, one of his predecessors,
who paid Polycarp the highest honour, even when assured that he
would not conform to the Western custom, and regarded his own as
more apostolical.
What the immediate result of these letters was we are not informed
by any contemporary writer. Anatolius, indeed, (if the Latin version
of his Treatise on the Paschal Cycle, published by Bucherius, is to be
relied on,) asserts that Victor did not persist in his
excommunication90; and we know subsequently91 [pg 049] that
many Churches in Asia adhered to the Jewish reckoning, and yet
were not on that account regarded with any aversion by their
brethren; and it was not until the council of Nice that their bishops
there assembled agreed to follow the general custom92,—to which,
however, many persons did not conform in the time of Chrysostom.
The part which the bishop of Rome took in this matter requires
perhaps a more explicit notice. It has, no doubt, been felt that Victor
acted in a manner which countenances the claims set up by the
popes of later days; but when we come to examine, we shall find
that whatever claims he advanced, beyond what we should allow,
were discountenanced by the then catholic Church. He did, or
attempted to do, two things: first, to bring the whole Church [pg
050] to one practice in the observance of the feast of Easter;
secondly, when he did not succeed with some Churches, to
excommunicate the dissentients.
Now so far we have no claim set up inconsistent [pg 051] with the
station of influence and dignity which we readily concede to have
appertained to the Roman bishops from very early times; and which,
if not most grossly abused, would never have been denied to them.
Some93 have supposed that he, with his letters, issued a threat of
excommunicating those Churches which refused to comply with the
western custom; but that is opposed to the sequel of the history,
from which we learn that such a threat would have called forth
remonstrances, of which in this stage of the business we hear
nothing.
Having received letters from every quarter except from Asia Minor,
stating that the traditional custom was the same as that of Rome, he
then, instead of proceeding by persuasion, immediately conceived
the idea of compelling the dissentient Churches to comply with his
wishes, by threatening to cut them off from communion if they
declined. His threat had no effect, and he proceeded to put it into
execution, nothing doubting that the Churches who had been with
him hitherto would still stand by him. And this is the point at which
we encounter something like the modern papal claims; for he
declared the Churches of Asia Minor cut off, not only from his
communion, but from the common unity94. Some might argue that
he must have had some foundation [pg 052] for this claim; but till
something of the kind can be shown, we have no need to suppose
any ground but a strong desire of a rash and determined mind to
carry the point he had undertaken. Be the ground what it may, the
Catholic Church negatived his claim; those who agreed with him in
the desire of bringing about unity of practice95 would not unite with
him in excommunicating their brethren, but rebuked him sharply96;
and Irenæus in particular represented to him the difference between
his spirit and that of his predecessors. And so entirely abortive was
his attempt, that, as we have seen, about sixty years after, Firmilian,
in his letter to Cyprian97, expressly asserted that the peace and unity
of the Catholic Church had never been broken by differences about
the observance of Easter or other religious rites: and that, in alluding
to the conduct of Stephen, bishop of Rome, who had quarrelled with
the African bishops because their custom differed from the Roman
on the subject of rebaptizing those who had been baptized by
heretics; which would necessarily have brought to mind any schism
produced by Victor, a previous bishop of Rome, if any such had been
produced.
Here, then, we have the most satisfactory evidence [pg 053] that
the Catholic Church, so near to the Apostles' times, had decided
against the power of the bishop of Rome to cut off whom he might
think fit from the common unity; not that they knew nothing of such
a claim, but that it was practically made and decided against.
[pg 054]
The Discourse concerning Easter, quoted by the author of the
Questions to the Orthodox100, formerly ascribed to Justin Martyr, may
have been his letter to Victor on that subject. Maximus101 cites some
Discourses on Faith, addressed to Demetrius, a deacon of Vienne, of
which we have two fragments, whether genuine or not, (numbered
IV. and V.) in the best editions of his Remains. Although forty-two
fragments, attributed to Irenæus, have been collected, chiefly from
Catenas, we have no clue for appropriating the greater part of them
to the writings of which they formed a portion. One of them (the last
in the Benedictine edition) is said to pertain to a discussion on the
Eternity of Matter; but whether belonging to a separate treatise, or a
remnant of his Discourse to the Gentiles, we have no means of
judging.
[pg 056]
Chapter II. Testimony of Irenæus to
Certain Facts of Church History.
There are several words in this passage which must influence the
sense of it. The first I shall notice is the word potentiorem, the more
especially as there is a various reading upon it. One MS. (the
Clermont) of considerable value, reads potiorem; but Massuet, who
examined it, says that it had been written pontiorem (but altered to
potiorem,) which is almost certainly a contraction for the common
reading. We must therefore, I conclude, sit down with the common
reading; although Massuet, in the Benedictine edition, and J. J.
Griesbach, in some remarks upon this passage140, prefer the other.
But what Greek word potentiorem represents must be matter of
conjecture; and no one who is acquainted with the manner in which
the translator has rendered Greek words will be inclined to lay much
stress upon it. It may have been put for ἱκανωτέραν, or κρείττονα;
or, in short, the comparative of any adjective which admits of being
rendered potens. We then come to the word principalitatem. This we
know that the ancient translator of Irenæus uses to signify ἀρχή141.
Putting these two together, Griesbach [pg 065] has rendered
κρείττονα ἀρχὴν, potiorem initium, and thus got rid of the idea of
authority altogether. But there is no need of this. Principalis is used
by the translator as the rendering of ἡγεμονικός142; principaliter, of
προηγουμένως143, and προηγητίκως144; principalitatem habeo, of
πρωτεύω145. We know that all the apostolical sees had a kind of
principality or pre-eminence above the surrounding Churches; a
more powerful pre-eminence than other Churches equally ancient
with themselves. Nay, we know that the Church of Rome had at that
time, in point of fact, a more powerful pre-eminence than any other
Church.
There are one or two more words still to be mentioned. Necesse est
is one of them. It may imply that it is the duty of every Church to
resort to Rome; but its more natural and usual meaning is, that, as a
matter of course, Christians from all parts, and not strictly the
Churches themselves, were led to resort thither by the superior
eminence of that Church.
I will close this whole discussion with two remarks; first, that unless
we could recover the Greek text of this passage, it is plainly
impossible to ascertain its true sense; and secondly, that the
strongest sense we can attach to it, consistently with history, is, that
Christians of that period from all parts of Christendom must, if they
wish to ascertain traditions, have recourse to the Church of Rome,
because, as the first Church in Christendom, the common traditions
were preserved there by the resort of Christians from all quarters.
This twofold reason for resorting thither has long ceased to exist,
and consequently this passage of Irenæus can afford no support to
the claims of modern Rome, until it can be proved that those
portions of the Christian world which are not in communion with her
are no part of the Catholic Church.
[pg 069]
There is another subject which has caused much discussion, which is
adverted to by Irenæus, viz. the miraculous powers of the Church.
He declares that in his time powers of this kind were possessed by
Christians, such as raising the dead149, and casting out devils, and
healing the sick; that they likewise had the gift of prophecy150, and
spoke with tongues, and [pg 070] revealed secret things of men and
mysteries of God151. It is well known that Gibbon and Middleton have
thrown doubt upon the miraculous powers of the primitive Church;
and one of their chief arguments is that the early writers, such as
Irenæus, content themselves with general statements, but bring no
specific instance. The subject has been very fully entered into by the
present highly learned and amiable bishop of Lincoln, Dr. Kaye, in his
work on Tertullian152; and in the general I am disposed to acquiesce
in the theory adopted by the bishop, that those powers were
conferred only by apostolical hands, and that of course they would
continue till all that generation was extinct who were contemporary
with St. John, the last of the Apostles. That would admit of Irenæus
having known instances; and not having any idea that the power
was to be extinct, he would think that it still remained, even if he
had not known any recent instances. It is necessary to remark,
however, that he speaks of the gifts of tongues and the revealing of
secrets and mysteries, not as a thing coming under his own
knowledge, but heard of from others; and it does not appear that he
intends to say that they continued to his own time. And I will
venture to observe that it appears rather unfair to Irenæus to set
[pg 071] aside his testimony by saying that he brings no specific
instance of those things which he speaks of as still done. He might
feel that the thing was so notorious, that those who were not
convinced by the notoriety of such occurrences would cavil at any
particular case he might select; and his mentioning that some of
those who had been delivered from evil spirits had become converts,
that some of those who had been raised from the dead, being poor,
had been assisted with money153, and that some had lived many
years after154, surely indicates that he was speaking from a
knowledge of individual cases. One should indeed have expected
that every one who owed his deliverance from Satanic possession to
the miraculous power possessed by Christians would have embraced
the faith of those who exercised it; and the circumstance that
Irenæus affirms this of some only gives a greater air of probability to
his whole statement. Besides this, we must distinguish between the
cases of persons healed by the direct agency of an individual, and
those in which it pleased God to hear the joint prayers of several; for
it is observable that our author attributes the raising of the dead
only to [pg 072] the united prayers and fasting of a whole Church,
and confines it to cases of great urgency155.
[pg 074]
Chapter III. On The Nature, Office,
Powers, and Privileges Of The Church.
Finally, although not exempt from weakness, and [pg 079] capable
of losing whole members, she, as a body, remains imperishable182.
[pg 082]
We find no trace in Irenæus of any authority in the Church of Rome
to decide controversies for the rest of the Church. On the contrary,
he taught Christians to have recourse to any ancient apostolical
Church, or rather collection of Churches186, if they wished to
ascertain the traditional system of the Church. He indeed quotes that
Church as being in his time a more important witness to the truth
than any other individual Church, because, through the continual
concourse of Christians thither, in consequence of its more powerful
pre-eminence, the traditions of the universal Church were there
collected as it were into a focus187; but, as I have pointed out
elsewhere188, he recognises no authority in that Church to claim to
decide controversies. With him it is not any individual Church that is
commissioned to preserve the truth, not even the Church of
Jerusalem, which he calls the mother of all Churches (a title which
has been since arrogated by the Roman Church), but the Catholic
Church, truly so called, by the mouth of her pastors throughout the
world; for although he mentions the pre-eminence of the Church of
Rome in his day as a matter of fact, he does not [pg 083] state it to
be a matter of right; nor does he ground any thing upon it but the
further fact that it followed, of course, that Christians resorted to it
from all quarters, as they did afterwards to Constantinople. He gives
no hint as to the source of that pre-eminence, other than its having
been settled by the two Apostles St. Peter and St. Paul, and
honoured with being the scene of their martyrdom189. And his appeal
to it he builds, not on any authority residing in it, but upon the fact
that at that time the confluence from all parts of the Church caused
the tradition of the whole Church to be best preserved there, as was
afterwards the case at Constantinople, and has since been no
where. So that his appeal to Rome is not in fact an appeal to that
Church, but to the Church universal; and since Rome has ceased to
be the place of resort to the universal Church, the ground for
appealing to her has ceased likewise.
Now Irenæus does undoubtedly call the same persons by the name
of Bishops and Presbyters interchangeably. But it has been long ago
pointed out that the circumstance of the same name being borne by
persons holding two different offices, proves nothing. It is unsafe to
infer from the circumstance that bishops are called presbyters, or
presbyters bishops, that therefore there was not a permanent officer
set over the other presbyters, and endued with functions which they
could not exercise, although not at first distinguished by a specific
name.
On the other hand, we learn from him that there were to be found in
every part of the Christian world bishops or presbyters placed at the
head of Churches, which from their importance, must have had
other presbyters in them, and which we know from other sources to
have had other presbyters in them; that there was only one of these
at one and the same time; that they were intrusted with the
government of the Churches, and called the Bishops of those
Churches; that the authority of the office was handed down from
individual to individual; and that the individuals who filled this office,
and by consequence [pg 085] the office itself, were appointed by
inspired apostles190. All these facts are irreconcileable with the
hypothesis that all presbyters were equal in authority and function.
The question whether these bishops and presbyters might not have
been simply pastors of independent congregations, is answered by
finding that they had other presbyters under them, (as Irenæus
under Pothinus, and Florinus and Blastus under the Bishops of
Rome,) and that in places such as Rome, where there were probably
more congregations than one.
[pg 088]
Chapter IV. On The Doctrine of the Holy
Trinity.
These are all the passages, so far as I have been able to discover,
which speak of the three Persons of the most Holy Trinity together;
but the doctrine is implied throughout.
[pg 091]
Very near the beginning of his treatise, in rehearsing the faith of the
Church, he speaks of “Christ Jesus our Lord and God and Saviour
and King199;” further on he quotes many passages of Scripture to
show that he was spoken of absolutely and definitely as God and
Lord200, and asks the question, [pg 092] How would men be saved, if
He who wrought out their salvation upon earth was not God201?
He asserts that the Word was with God from everlasting202, and that
Jesus was the Son of God before the creation203, that no man knows
the mode of his [pg 093] generation204, and that God made all things
by his indefatigable Word, who is the Artificer of all things, and
sitteth upon the cherubim, and preserves all things205. He declares
that the Lord who spake to Abraham was the Son206, and that it was
the Word that appeared to Moses207.
This Divine Word, then, was united with his creature208, (which union
is expressed by the name Emmanuel209,) and humbled himself to
take upon him [pg 094] the infant state of man210, and thus having
become Son of man211, went through all the ages of man212, and
finally hung upon the cross213. He asserts, moreover, that although
the angels knew the Father solely by the revelation of the Son214,
and indeed all [pg 095] from the beginning have known God by the
Son215, so that the Father is the Son invisible, and the Son the Father
visible216, yet that the Son knew not the day of judgment217; and
that this was so ordered, that we may learn that the Father is above
all218, and that the Son ministers to the Father219: finally, that when
Jesus was tempted and suffered, the Word in him restrained his
energy220. But he declares likewise that Christ remained in the
bosom of the Father, even when upon earth221.
[pg 096]
These mysteries in the nature of Christ Irenæus does not attempt to
explain, fully holding the eternal and unchangeable Divinity of the
Son, even when made flesh, and his strict personal union with that
flesh, and at the same time asserting his subordination to the Father,
even in his divine nature; feeling that when we cannot discover the
reason of every thing, we should consider the immeasureable
difference between us and God222; that if we cannot explain earthly
things, we cannot expect to explain heavenly things, and that what
we cannot explain we must leave to God223; and in short that it [pg
097] is much better to know nothing but Christ crucified, than by
subtil inquiries to fall into impiety224.
This Jesus, then, who has been testified of by all things that he was
truly God and truly man225, being related to both God and man, and
thus having the indispensable qualification for his office, became the
Mediator between them226; he came in every dispensation, [pg 098]
and summed up all things in himself227. He was born about the forty-
first year of the reign of Augustus228; when not full thirty he was
baptized, but he did not begin to teach till past forty229. His ministry
extended through three passovers230, and [pg 099] he suffered on
the day of the passover231. He is our High Priest232; he gave his soul
for our souls, and his flesh for ours 233; his righteous flesh has
reconciled to God our sinful flesh 234; and he brings us into union
and communion with God235. He rose again in the flesh236, and in the
flesh he ascended into heaven, and [pg 100] will come again to
judgment237; and he introduces his Church into the kingdom of
heaven238.
Respecting the Holy Ghost, Irenæus declares that he was with God
before all created things239, and (as we have seen) that he was the
Wisdom of God, whose operation was the operation of God240; that
he is rightly called Lord241; and he affirms that the bread of eternal
life, which is the Word, is also the Spirit of the Father242. He speaks
of him as coming with power to give entrance unto life to all nations,
and to open to them the new Covenant, and as offering to the
Father on the day of Pentecost the first fruits of all nations243.
[pg 101]
He affirms that man, at his creation, had the image of God in the
flesh, the likeness in the soul by the communication of the Divine
Spirit244. He implies that, since the fall, man has lost the Spirit, and
consequently the life of his soul; he asserts that he remains carnal
until he recovers the Spirit of God245, and then he becomes again a
living soul, and has in him the seed of eternal life246; that the Spirit
[pg 102] we receive here is a pledge of a fuller portion247; and that
at the resurrection the souls and bodies of the just will be quickened
by the Spirit in union with them, and their bodies become spiritual
bodies248, and capable of immortality.
[pg 103]
Chapter V. The Origin of Evil.
This being the subject out of which the Gnostic theories appear to
have arisen (there being so many attempts to account for it, without
in any wise bringing it into connexion with the Supreme Being), it
might, perhaps, have been expected that Irenæus should have
endeavoured to throw some light upon it. He has, however, taken a
much wiser course. He has altogether declined making it clear, and
thereby escaped the danger of inventing another heresy.
[pg 106]
He notwithstanding suggests this practical good arising out of the
existence of evil, that the love of God will be more earnestly
cherished for ever by those who have known by experience the evil
of sin, and have obtained their deliverance from it not without their
own exertion; and therefore that this may be regarded as a reason
why God permitted evil253.
[pg 107]
Chapter VI. The Evil Spirits.
Although Irenæus does not think proper to discuss the subject of the
origin of evil, properly so called, he speaks agreeably to the
Scriptures as to its introduction into this lower world, and in some
degree fills up their outline. Thus he describes Satan as having been
originally one of the angels who had power over the air254. He
attributes the beginning of his overt acts of rebellion to his envy
towards man255, because he had been made in the image of [pg
108] God, i. e. immortal256; whom through envy he stirred up to
rebellion likewise257, and that by falsehood258, [pg 109] putting on
the form of the serpent, that he might escape the eye of God259:
wherefore, although God had pity upon man, as having fallen
through weakness260, and because otherwise Satan would have
frustrated the Divine purpose261, he totally cut off from himself the
apostate angels262, and doomed them and their Prince to the eternal
fire263, which he had from the beginning prepared for obstinate
transgressors264, [pg 110] although he did not make known to them
at that time that their lot was irremediable265.
The next act of the apostate spirits was to mingle themselves with
human nature by carnal copulation with women, and thus to cause
the total corruption of the old world and its inhabitants
(notwithstanding the preaching of Enoch to these fallen spirits), and
consequently their destruction266.
[pg 111]
Irenæus makes none but very general allusions to the agency of the
fallen spirits from the fall of man till the coming of Christ. He
declares that, up to that time267, they had not ventured upon
blaspheming God; but that then, becoming aware that everlasting
fire was the appointed recompense of those who continued [pg 112]
in rebellion without repentance, they felt themselves already
condemned, and waxing desperate, charged all the sin of their
rebellion on their Maker, by inspiring the Gnostics with their impious
tenets268. It seems to be implied that sentence is not yet pronounced
upon the fallen angels269.
[pg 113]
Chapter VII. The Divine Dispensations.
After the introduction of evil into creation, and the agency by which
it is propagated in the world, we have next to notice the Divine plans
for its counteraction and removal; and as Irenæus was opposing the
Gnostic notion that the whole government of the world, prior to the
Gospel, was in the hands of beings adverse to the Supreme Being,
he was naturally led to show that, on the contrary, the whole history
of mankind has been a series of dispensations emanating from one
and the same Supreme and only God.
[pg 118]
He distinguishes, however, between what he calls the natural
portions of the law and the rest. As they were kept by good men
before the law279, so he conceives them to be binding on us ever
since280. It [pg 119] is not at first sight clear what he means by that
term, but he expressly informs us that he comprises in it the whole
decalogue281. And yet there is every appearance that he would
exclude the fourth commandment, which he expressly asserts not to
have been observed before the giving of the law282.
But although the precepts of the moral law are equally binding at all
times, he thought that they were not formally given to the just men
of old, because they observed them voluntarily, being a law unto
themselves283. But when God's people forgot [pg 120] them in the
land of Egypt, then it became necessary distinctly to enact them, to
prepare man for the fuller duties of love to God and goodwill to
man284. And when they did not obey the moral law, he added to it
the ceremonial285, that, by types, their servile and childish natures
might be trained up to the apprehension of realities; by temporal
things, of eternal; by carnal, of spiritual; by earthly, of heavenly286.
Some of their ordinances had a twofold use; as circumcision was
intended, equally with their rites and ceremonies, to keep them
distinct from the heathen, and also to signify the circumcision of the
soul287.
[pg 121]
To show that the moral law was preparatory to the Gospel, he
alleges the fact that Jesus taught its precepts as the way of life to
the young lawyer who came to inquire of him; not supposing that
these were sufficient in themselves, but that they were steps to the
knowledge of Christ288.
He, however, thought that our Lord wished that the whole
ceremonial law should be observed as long as Jerusalem stood289.
But although he appears to think that the law, as a whole and in the
letter, is no longer binding to Christians, he does not think that this
leaves us at liberty to do as we like. If we are not tied down [pg
122] to the letter, like slaves, that is because it was intended that
the law of liberty should be of wider range, and our obedience
extend itself beyond the letter, and that our subjection to our
Heavenly King should be more hearty and thoroughgoing than ever;
and therefore, if we wish to remain in the way of salvation through
Christ, we must voluntarily adopt the precepts of the decalogue,
and, giving them a completer meaning, endeavour to realize in our
conduct all the fulness of their enlarged application290.
[pg 123]
It is almost unnecessary to point out the exact agreement of these
sentiments with the seventh and fourteenth articles of the Church of
England, and how impossible it must be for a person holding them
to think that we can do any thing whatever beyond what Christ has
a right to expect from us. It is manifest that he would not have
thought that any degrees of Christian holiness are really at our
option, whether we shall seek them or not; but that every person
who, having any degree of perfection, or any means of advancement
placed before him, knowingly neglects it, becomes thereby unworthy
of him who has given him liberty291, and hazards his salvation: in
short, that “to whom much is given, of him will much be required.”
[pg 124]
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.
ebookmasss.com