julie.com.mikaelson.application.WebSecurityConfig.java Source code

Java tutorial

Introduction

Here is the source code for julie.com.mikaelson.application.WebSecurityConfig.java

Source

/******************************************************************************
 * @File name   :      WebSecurityConfig.java
 *
 * @Author      :      Niklaus Mikaelson
 *
 * @Date        :      2016414
 *
 * @Copyright Notice: 
 * Copyright (c) 2020 Niklaus Mikaelson, Inc. All  Rights Reserved.
 * This software is published under the terms of the Niklaus Mikaelson Software
 * License version 1.0, a copy of which has been included with this
 * distribution in the LICENSE.txt file.
 * 
 * 
 * ----------------------------------------------------------------------------
 * Date                   Who         Version        Comments
 * 2016414 ?2:52:46        Niklaus Mikaelson     1.0            Initial Version
 *****************************************************************************/
package julie.com.mikaelson.application;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;

/**
 *
 */
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {

    @Autowired
    public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
        auth.inMemoryAuthentication().withUser("user").password("password").roles("ADMIN");
    }

    /**
     * {@inheritDoc}
     * overridden:
     * @Date : 2016517
     * @see org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter#configure(org.springframework.security.config.annotation.web.builders.HttpSecurity)
     **/

    @Override
    protected void configure(HttpSecurity http) throws Exception {
        // TODO Auto-generated method stub
        super.configure(http);
    }

    /**
     * {@inheritDoc}
     * overridden:
     * @Date : 2016517
     * @see org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter#configure(org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder)
     **/

    @Override
    protected void configure(AuthenticationManagerBuilder auth) throws Exception {
        // TODO Auto-generated method stub
        super.configure(auth);
    }

    /**
     * {@inheritDoc}
     * overridden:
     * @Date : 2016517
     * @see org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter#configure(org.springframework.security.config.annotation.web.builders.WebSecurity)
     **/

    @Override
    public void configure(WebSecurity web) throws Exception {
        // TODO Auto-generated method stub
        super.configure(web);
    }

}